1 /**************************************************************************
2 // Create TClonesArray of zero misalignment objects for PMD
4 // Macro to randomly displace the 4 sectors of the PMD
5 // in each plane. Each sector (to be misaligned)
6 // of PMD houses the following :
7 // (a) 6 modules of preshower plane
8 // (b) 6 modules of veto plane
9 // (c) The FEE boards on back plane of each module
10 // (d) 6 modules of convertor plates
11 // The clustering is done module-wise
12 // The actual amount displacement will be provided
13 // by the survey data and has to be converted into
14 // displacement in x,y,z,theta, phi and psi
16 // Now specify the path of the module to be misaligned
17 // as followed in the PMD geant
28 // Misalignment Matrix is expected to be
29 // same for sectors 1 and 4
30 // and for the sectors 2 and 3
31 // As these will be mounted on the same
34 * Mon Nov 22 19:54:27 CET 2010
39 **************************************************************************/
41 void MakePMDZeroMisAlignment(){
42 const char* macroname = "MakePMDZeroMisAlignment.C";
44 //Create a TClonesArray of Align Object to store displacement Angles
45 TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
46 TClonesArray &alobj = *array;
48 Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
49 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
50 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
51 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
55 TString snSector(Form("PMD/Sector%d",i));
56 new(alobj[j++]) AliAlignObjParams(snSector.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
59 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
60 // Create a File to store the alignment data
61 const char* filename = "PMDzeroMisalignment.root";
62 TFile f(filename,"RECREATE");
64 Error(macroname,"cannot open file for output\n");
67 Info(macroname,"Saving alignment objects to the file %s", filename);
69 f.WriteObject(array,"PMDAlignObjs","kSingleKey");
72 // save in CDB storage
73 TString Storage = gSystem->Getenv("STORAGE");
74 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
75 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
78 Info(macroname,"Saving alignment objects in CDB storage %s",
80 AliCDBManager* cdb = AliCDBManager::Instance();
81 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
83 Error(macroname,"Unable to open storage %s\n",Storage.Data());
86 AliCDBMetaData* md = new AliCDBMetaData();
87 md->SetResponsible("Satyajit Jena");
88 md->SetComment("Zero misalignment for PMD");
89 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
90 AliCDBId id("PMD/Align/Data",0,AliCDBRunRange::Infinity());
91 storage->Put(array,id,md);