forked from miranov25/AliRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakeHMPIDAlignmentObjs.C
More file actions
65 lines (57 loc) · 2.12 KB
/
Copy pathMakeHMPIDAlignmentObjs.C
File metadata and controls
65 lines (57 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "TSystem.h"
#include "TROOT.h"
#include "TGeoManager.h"
#include "TObjString.h"
#include "TClonesArray.h"
#include "TError.h"
#include "AliGeomManager.h"
#include "AliCDBManager.h"
#include "AliCDBStorage.h"
#include "AliCDBPath.h"
#include "AliCDBEntry.h"
#include "AliCDBId.h"
#include "AliCDBMetaData.h"
#include "AliMisAligner.h"
#include "AliHMPIDMisAligner.h"
#include <TString.h>
#endif
void MakeHMPIDAlignmentObjs(Bool_t toOCDB = kFALSE, const char* misalType="residual")
{
// Make alignment objects for HMPID detector
// for the misalignment scenario passed as argument "misalType".
//Input Args: toOCDB = kFALSE -> the results are written in a local file called HMPIDMisalignObject.root
// kTRUE -> the results are written in local://$ALICE_ROOT/OCD
// misalType = ideal, residual, full (see class AliHMPIDMisAligner)
const char* macroname = "MakeHMPIDAlignmentObjs.C";
// Load geometry from OCDB; update geometry before loading it if we are going to load
// the alignment objects to the OCDB
AliCDBManager* cdb = AliCDBManager::Instance();
if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdb->SetRun(0);
// AliCDBStorage* storage = 0;
AliGeomManager::LoadGeometry(); //load geom from default OCDB storage
TClonesArray* objsArray = 0;
AliHMPIDMisAligner* misAlignerHMPID = new AliHMPIDMisAligner();
misAlignerHMPID->SetMisalType(misalType);
objsArray = misAlignerHMPID->MakeAlObjsArray();
if(toOCDB)
{
AliCDBId id("HMPID/Align/Data",0,AliCDBRunRange::Infinity());
AliCDBMetaData *md = misAlignerHMPID->GetCDBMetaData();
md->SetResponsible("Domenico Di Bari");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
cdb->Put(objsArray,id,md);
} else {
// save on file
TFile file("HMPIDMisalignObject.root","RECREATE");
if(!file) {
Error(macroName,"cannot open file for output\n");
return;
}
file.cd();
file.WriteObject(objsArray,"HMPIDAlignObjs","kSingleKey");
file.Close();
}
return;
}