]>
Commit | Line | Data |
---|---|---|
e064ab4a | 1 | //____________________________________________________________________ |
2 | // | |
3 | // $Id: PatternDigits.C 28055 2008-08-18 00:33:20Z cholm $ | |
4 | // | |
5 | // Draw hits in the specialised FMD event display | |
6 | // | |
7 | /** Display hits | |
8 | @ingroup FMD_script | |
9 | */ | |
10 | Bool_t | |
11 | CheckFile(const char* prefix, int number, TString& f) | |
12 | { | |
13 | f = (Form("%s%d.csv", prefix, number)); | |
14 | std::cout << "Checking if " << f << " exists ... " << std::flush; | |
15 | f = gSystem->Which("$(HOME)/calib/", f.Data()); | |
16 | std::cout << '"' << f << '"' << std::endl; | |
17 | return !f.IsNull(); | |
18 | } | |
19 | void | |
20 | PatternCalib(const char* file="raw.root", Int_t runno=0) | |
21 | { | |
22 | // AliLog::SetModuleDebugLevel("FMD", 1); | |
23 | gSystem->Load("libFMDutil.so"); | |
24 | ||
25 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
26 | const char* cdbUri = gSystem->Getenv("AMORE_CDB_URI"); | |
27 | cdb->SetDefaultStorage(cdbUri); | |
28 | cdb->SetRun(runno); | |
29 | ||
30 | AliFMDCalibStripRange* range = new AliFMDCalibStripRange; | |
31 | AliFMDCalibSampleRate* rate = new AliFMDCalibSampleRate; | |
32 | AliFMDCalibPedestal* peds = new AliFMDCalibPedestal; | |
33 | AliFMDCalibGain* gains = new AliFMDCalibGain; | |
34 | Bool_t gotConds = kFALSE; | |
35 | Bool_t gotPeds = kFALSE; | |
36 | Bool_t gotGains = kFALSE; | |
37 | for (Int_t i = 1; i <= 3; i++) { | |
38 | TString f; | |
39 | if (CheckFile("conditions", i, f)) { | |
40 | gotConds = kTRUE; | |
41 | std::cout << "Reading conditions for FMD" <<i<< " from " <<f<< std::endl; | |
42 | std::ifstream in(f.Data()); | |
43 | range->ReadFromFile(in); | |
44 | rate->ReadFromFile(in); | |
45 | } | |
46 | if (CheckFile("peds", i, f)) { | |
47 | gotPeds = kTRUE; | |
48 | std::cout << "Reading pedestals for FMD" <<i<< " from " <<f<< std::endl; | |
49 | std::ifstream in(f.Data()); | |
50 | peds->ReadFromFile(in); | |
51 | } | |
52 | if (CheckFile("gains", i, f)) { | |
53 | gotGains = kTRUE; | |
54 | std::cout << "Reading gains for FMD" <<i<< " from " <<f<< std::endl; | |
55 | std::ifstream in(f.Data()); | |
56 | gains->ReadFromFile(in); | |
57 | } | |
58 | } | |
59 | ||
60 | Int_t mask = (AliFMDParameters::kDeadMap| | |
61 | AliFMDParameters::kZeroSuppression| | |
62 | AliFMDParameters::kAltroMap); | |
63 | ||
64 | ||
65 | if (!gotConds) mask |= AliFMDParameters::kStripRange; | |
66 | if (!gotConds) mask |= AliFMDParameters::kSampleRate; | |
67 | if (!gotPeds) mask |= AliFMDParameters::kPedestal; | |
68 | if (!gotGains) mask |= AliFMDParameters::kPulseGain; | |
69 | ||
70 | AliFMDParameters* pars = AliFMDParameters::Instance(); | |
71 | pars->Init(kFALSE, mask); | |
72 | ||
73 | if (gotConds) pars->SetStripRange(range); | |
74 | if (gotConds) pars->SetSampleRate(rate); | |
75 | if (gotPeds) pars->SetPedestal(peds); | |
76 | if (gotGains) pars->SetGain(gains); | |
77 | ||
78 | // pars->Print("pedestal"); | |
79 | ||
80 | AliFMDPattern* d = new AliFMDPattern; | |
81 | d->AddLoad(AliFMDInput::kRawCalib); | |
82 | d->SetRawFile(file); | |
83 | d->SetName("rawCalib"); | |
84 | d->SetTitle("Calibrated Raw"); | |
e1a9aea4 | 85 | d->SetFactor(5); |
86 | d->SetCut(0.02, 1); | |
e064ab4a | 87 | d->Run(); |
88 | } | |
89 | ||
90 | //____________________________________________________________________ | |
91 | // | |
92 | // EOF | |
93 | // |