59 const char* calibDir = 0,
60 Double_t noiseFactor = 5,
74 if (calibDir) fCalibDir = calibDir;
76 fELoss =
new TH1D(
"eLoss",
"Scaled Energy loss", m, mmin, mmax);
77 fELoss->SetXTitle(
"#Delta E/#Delta E_{mip}");
79 fELoss->SetDirectory(0);
90 f = (Form(
"%s%d.csv", prefix, number));
91 f = gSystem->Which(fCalibDir.Data(), f.Data());
106 for (Int_t i = 1; i <= 3; i++) {
109 Info(
"Init",
"Reading conditions for FMD%d from %s", i, f.Data());
112 std::ifstream in(f.Data());
117 Info(
"Init",
"Reading pedestals for FMD%d from %s", i, f.Data());
119 std::ifstream in(f.Data());
123 Info(
"Init",
"Reading gains for FMD%d from %s", i, f.Data());
125 std::ifstream in(f.Data());
140 pars->
Init(kFALSE, mask);
145 if (gains) pars->
SetGain(gains);
149 if (!fDets)
return ret;
153 Int_t m = fELoss->GetXaxis()->GetNbins();
154 Int_t mmin = fELoss->GetXaxis()->GetXmin();
155 Int_t mmax = fELoss->GetXaxis()->GetXmax();
156 for (Int_t d = 1; d <= 3; d++) {
157 Int_t nRng = (d == 1 ? 1 : 2);
159 fDets->AddAt(det =
new TObjArray(nRng), d-1);
160 det->SetName(Form(
"FMD%d", d));
161 TDirectory* detD = fOut->mkdir(det->GetName());
162 for (Int_t q = 0; q < nRng; q++) {
163 Char_t r = q == 0 ?
'I' :
'O';
164 Int_t nSec = q == 0 ? 20 : 40;
165 Int_t nStr = q == 0 ? 512 : 256;
167 det->AddAt(rng =
new TObjArray(nSec), q);
168 rng->SetName(Form(
"FMD%d%c", d, r));
169 TDirectory* rngD = detD->mkdir(rng->GetName());
170 for (Int_t s = 0; s < nSec; s++) {
172 rng->AddAt(sec =
new TObjArray(nStr), s);
173 sec->SetName(Form(
"FMD%d%c_%02d", d, r, s));
174 TDirectory* secD = rngD->mkdir(sec->GetName());
175 for (Int_t t = 0; t < nStr; t++) {
177 TH1* str =
new TH1D(Form(
"FMD%d%c_%02d_%03d", d, r, s, t),
178 Form(
"Scaled energy loss in FMD%d%c[%2d,%3d]",
179 d, r, s, t), m, mmin, mmax);
180 str->SetXTitle(
"#Delta E/#Delta E_{mip}");
201 if (!digit)
return kTRUE;
205 Char_t r = digit->
Ring();
206 UShort_t s = digit->
Sector();
207 UShort_t t = digit->
Strip();
211 Double_t adc = digit->
Counts();
212 Double_t threshold = pedW *
fFactor;
213 if (gain < 0.1 || gain > 10)
return kTRUE;
215 Warning(
"ProcessRawCalibDigit",
"FMD%d%c[%2d,%3d] is noisy: %f",
225 if (adc < threshold)
return kTRUE;
227 Double_t mult = (adc-ped) / (gain * parm->
GetDACPerMIP());
236 TH1* str =
static_cast<TH1*
>(sec->At(t));
244 if (fHasData) fGotNEvents++;
250 std::cout <<
"A total of " << fGotNEvents <<
" with data" << std::endl;
253 gStyle->SetCanvasColor(0);
254 gStyle->SetCanvasBorderSize(0);
256 gStyle->SetPadBorderSize(0);
257 fELoss->SetStats(kFALSE);
258 fELoss->SetFillColor(kRed);
259 fELoss->SetFillStyle(3001);
260 fELoss->Scale(1. / fELoss->GetEntries());
261 fELoss->DrawCopy(
"e1 bar");
264 std::cout <<
"Flusing to disk ... " << std::flush;
269 std::cout <<
"done" << std::endl;
Float_t GetDACPerMIP() const
TFile * Open(const char *filename, Long64_t &nevents)
Bool_t ProcessRawCalibDigit(AliFMDDigit *digit)
UShort_t NoiseFactor(UShort_t ddl) const
Per strip map of energy deposited and number of hits.
void ReadFromFile(std::istream &inFile)
This class is a singleton that handles various parameters of the FMD detectors. This class reads from...
Manager of FMD parameters.
Float_t GetPulseGain(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
Per digitizer card pulser calibration.
Bool_t ReadFromFile(std::istream &inFile)
void SetSampleRate(UShort_t r=2)
Per strip pedestal calibration.
Gain value and width for each strip in the FMD.
Per digitizer card pulser calibration.
Per digitizer card pulser calibration.
Bool_t IsZeroSuppressed(UShort_t ddl) const
Bool_t CheckFile(const char *prefix, int number, TString &f)
void SetStripRange(UShort_t min=0, UShort_t max=127)
Per strip gain calibration.
Bool_t ReadFromFile(std::istream &inFile)
static AliFMDParameters * Instance()
void SetDefaultStorage(const char *dbString)
void SetGain(AliFMDCalibGain *g)
Per digitizer card pulser calibration.
void SetPedestal(Float_t p=100)
DrawCalibRaw(const char *file, const char *calibDir=0, Double_t noiseFactor=5, Bool_t save=kTRUE, Int_t m=420, Double_t mmin=-0.5, Double_t mmax=20.5)
void ReadFromFile(std::istream &)
UShort_t Detector() const
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
Float_t GetPedestal(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
Float_t GetPedestalWidth(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
Pedestal value and width for each strip in the FMD.
UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll)