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 ZDC. 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 "AliZDCMisAligner.h"
28 #include "AliGeomManager.h"
29 #include "TClonesArray.h"
30 #include "AliAlignObjParams.h"
33 ClassImp(AliZDCMisAligner)
35 //_______________________________________________________________________________________
36 AliZDCMisAligner::AliZDCMisAligner() : AliMisAligner()
43 //_______________________________________________________________________________________
44 TClonesArray* AliZDCMisAligner::MakeAlObjsArray() {
45 // builds and returns the array of alignment objects
46 // according to the spcified misalignment scenario
47 // ("ideal", "residual" or "full").
49 TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
50 TClonesArray &alobj = *array;
52 Double_t dx,dy,dz,dpsi,dtheta,dphi;
53 if(TString(GetMisalType())=="ideal")
56 dpsi=0., dtheta=0., dphi=0.;
57 }else if(TString(GetMisalType())=="residual" || TString(GetMisalType())=="full")
59 dx=0., dy=0.05, dz=0.;
60 dpsi=0., dtheta=0., dphi=0.;
62 AliError(Form("\"%s\" is not a valid identifier for misalignment types. Exiting ...",GetMisalType()));
66 const char *zdcCn="ZDC/NeutronZDC_C";
67 const char *zdcCp="ZDC/ProtonZDC_C";
68 const char *zdcAn="ZDC/NeutronZDC_A";
69 const char *zdcAp="ZDC/ProtonZDC_A";
72 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
73 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
75 new(alobj[0]) AliAlignObjParams(zdcCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
76 new(alobj[1]) AliAlignObjParams(zdcCp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
77 new(alobj[2]) AliAlignObjParams(zdcAn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
78 new(alobj[3]) AliAlignObjParams(zdcAp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
83 //_______________________________________________________________________________________
84 AliCDBMetaData* AliZDCMisAligner::GetCDBMetaData() const {
85 // Returns the comment and responsible for the
86 // AliCDBMetaData to be associated with the OCDB entry
87 // containing the ZDC array of misalignment objects
89 AliCDBMetaData* md = new AliCDBMetaData();
90 md->SetResponsible("Chiara Oppedisano");
92 if(TString(GetMisalType())=="ideal")
93 md->SetComment("Alignment objects for ZDC ideal misalignment");
94 if(TString(GetMisalType())=="residual")
95 md->SetComment("Alignment objects for ZDC residual misalignment");
96 if(TString(GetMisalType())=="full")
97 md->SetComment("Alignment objects for ZDC full misalignment");