1+ // Copyright 2021-2025 CERN and copyright holders of ALICE O2.
2+ // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+ // All rights not expressly granted are reserved.
4+ //
5+ // This software is distributed under the terms of the GNU General Public
6+ // License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+ //
8+ // In applying this license CERN does not waive the privileges and immunities
9+ // granted to it by virtue of its status as an Intergovernmental Organization
10+ // or submit itself to any jurisdiction.
11+
12+ /// \file FT0Misaligner.C
13+ /// \brief ROOT macro for creating an FT0 geometry alignment object. Based on ITSMisaligner.C
14+ ///
15+ /// \author Andreas Molander andreas.molander@cern.ch, Alla Maevskaya
16+
117#if !defined(__CLING__ ) || defined(__ROOTCLING__ )
2- //#define ENABLE_UPGRADES
18+
19+ #include "CCDB/CcdbApi.h"
320#include "DetectorsCommonDataFormats/DetID.h"
421#include "DetectorsCommonDataFormats/DetectorNameConf.h"
522#include "DetectorsCommonDataFormats/AlignParam.h"
6- #include "DetectorsBase/GeometryManager.h"
7- #include "CCDB/CcdbApi.h"
8- #include "FT0Base/Geometry.h"
9- #include <TRandom.h>
23+
1024#include <TFile.h>
1125#include <vector>
1226#include <fmt/format.h>
27+
1328#endif
1429
1530using AlgPar = std ::array < double , 6 > ;
@@ -23,19 +38,15 @@ void FT0Misaligner(const std::string& ccdbHost = "http://ccdb-test.cern.ch:8080"
2338 const std ::string & fileName = "FT0Alignment.root" )
2439{
2540 std ::vector < o2 ::detectors ::AlignParam > params ;
26- o2 ::base ::GeometryManager ::loadGeometry ("" , false);
27- // auto geom = o2::ft0::Geometry::Instance();
2841 AlgPar pars ;
2942 bool glo = true;
3043
3144 o2 ::detectors ::DetID detFT0 ("FT0" );
3245
33- // FT0 detector
34- //set A side
3546 std ::string symNameA = "FT0A" ;
3647 pars = generateMisalignment (xA , yA , zA , psiA , thetaA , phiA );
3748 params .emplace_back (symNameA .c_str (), -1 , pars [0 ], pars [1 ], pars [2 ], pars [3 ], pars [4 ], pars [5 ], glo );
38- //set C side
49+
3950 std ::string symNameC = "FT0C" ;
4051 pars = generateMisalignment (xC , yC , zC , psiC , thetaC , phiC );
4152 params .emplace_back (symNameC .c_str (), -1 , pars [0 ], pars [1 ], pars [2 ], pars [3 ], pars [4 ], pars [5 ], glo );
@@ -57,14 +68,15 @@ void FT0Misaligner(const std::string& ccdbHost = "http://ccdb-test.cern.ch:8080"
5768 algFile .Close ();
5869 }
5970}
71+
6072AlgPar generateMisalignment (double x , double y , double z , double psi , double theta , double phi )
6173{
6274 AlgPar pars ;
63- pars [0 ] = gRandom -> Gaus ( 0 , x ) ;
64- pars [1 ] = gRandom -> Gaus ( 0 , y ) ;
65- pars [2 ] = gRandom -> Gaus ( 0 , z ) ;
66- pars [3 ] = gRandom -> Gaus ( 0 , psi ) ;
67- pars [4 ] = gRandom -> Gaus ( 0 , theta ) ;
68- pars [5 ] = gRandom -> Gaus ( 0 , phi ) ;
75+ pars [0 ] = x ;
76+ pars [1 ] = y ;
77+ pars [2 ] = z ;
78+ pars [3 ] = psi ;
79+ pars [4 ] = theta ;
80+ pars [5 ] = phi ;
6981 return std ::move (pars );
7082}
0 commit comments