1 /**************************************************************************
2 * Copyright(c) 2007-2010, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //========================================================================
18 // This class generates misalignment for VZERO. In particular it defines
19 // the misalignment in the three canonical scenarios: "ideal", "residual"
21 // It is meant to be run standalone or from the steering macro
22 // $ALICE_ROOT/macros/MakeAlignmentObjs.C
23 // looping on the detectors.
25 //========================================================================
27 #include "AliVZEROMisAligner.h"
28 #include "AliGeomManager.h"
29 #include "AliMathBase.h"
30 #include "TClonesArray.h"
32 #include "AliAlignObjParams.h"
35 ClassImp(AliVZEROMisAligner)
37 //_______________________________________________________________________________________
38 AliVZEROMisAligner::AliVZEROMisAligner() : AliMisAligner()
45 //_______________________________________________________________________________________
46 TClonesArray* AliVZEROMisAligner::MakeAlObjsArray() {
47 // builds and returns the array of alignment objects
48 // according to the spcified misalignment scenario
49 // ("ideal", "residual" or "full").
51 TClonesArray *array = new TClonesArray("AliAlignObjParams",2);
52 TClonesArray &alobj = *array;
54 Double_t dx, dy, dz, dpsi, dtheta, dphi;
55 gRandom->SetSeed(4321);
56 Double_t sigmatr; // max shift in cm
57 Double_t sigmarot; // max rot in degrees
59 TString v0alignable[2]={"VZERO/V0C", "VZERO/V0A"};
61 Int_t iIndex=0; // VZERO is not indexed
62 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
63 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
65 if(TString(GetMisalType())=="ideal")
68 for(Int_t ii=0; ii<2; ii++)
69 new(alobj[ii]) AliAlignObjParams(v0alignable[ii].Data(), volid, 0., 0., 0., 0., 0., 0., kTRUE);
71 }else if(TString(GetMisalType())=="residual" || TString(GetMisalType())=="full"){
73 if(!AliGeomManager::GetGeometry())
75 AliError("No geometry loaded into AliGeomManager! Returning null pointer!");
82 for(Int_t ii=0; ii<2; ii++)
84 dx = AliMathBase::TruncatedGaus(0.,sigmatr, 3*sigmatr);
85 dy = AliMathBase::TruncatedGaus(0.,sigmatr, 3*sigmatr);
86 dz = AliMathBase::TruncatedGaus(0.,sigmatr, 3*sigmatr);
87 dpsi = AliMathBase::TruncatedGaus(0.,sigmarot, 3*sigmarot);
88 dtheta = AliMathBase::TruncatedGaus(0.,sigmarot, 3*sigmarot);
89 dphi = AliMathBase::TruncatedGaus(0.,sigmarot, 3*sigmarot);
90 new(alobj[ii]) AliAlignObjParams(v0alignable[ii].Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
94 AliError(Form("\"%s\" is not a valid identifier for misalignment types. Exiting ...",GetMisalType()));
101 //_______________________________________________________________________________________
102 AliCDBMetaData* AliVZEROMisAligner::GetCDBMetaData() const {
103 // Returns the comment and responsible for the
104 // AliCDBMetaData to be associated with the OCDB entry
105 // containing the VZERO array of misalignment objects
107 AliCDBMetaData* md = new AliCDBMetaData();
108 md->SetResponsible("Brigitte Cheynis");
110 if(TString(GetMisalType())=="ideal")
111 md->SetComment("Alignment objects for VZERO ideal misalignment");
112 if(TString(GetMisalType())=="residual")
113 md->SetComment("Alignment objects for VZERO residual misalignment");
114 if(TString(GetMisalType())=="full")
115 md->SetComment("Alignment objects for VZERO full misalignment");