21 const char* dir = getenv(
"VMCWORKDIR");
24 Error(__func__,
"No ECAL in run %lu\n", runId);
34 }
else if (runId < 5186) {
38 else if (runId < 3514)
40 else if (runId < 3589)
42 else if (runId < 4153)
44 else if (runId < 4307)
46 else if (runId < 4906)
48 else if (runId < 4976)
62 Error(__func__,
"Unable to determine ECAL position for runId %lu\n", runId);
90 in.open(map_file_name);
92 Fatal(__func__,
"Loading ECAL Map from file: %s - file open error!\n", map_file_name);
95 Info(__func__,
"Loading ECAL Map from file: %s\n", map_file_name);
97 in >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy;
103 in >> std::hex >> adcId >> std::dec >> adcChan >> chan >> x >> y;
106 if (adcId == 0 || adcChan == 0 || chan <= 0)
117 in.open(calibr_file_name);
119 Fatal(__func__,
"Loading ECAL Calibration from file: %s - file open error!\n", calibr_file_name);
122 Info(__func__,
"Loading ECAL Calibration from file: %s\n", calibr_file_name);
124 in >> dummy >> dummy >> dummy >> dummy;
128 in >> chan >> coeff >> err;
143 Fatal(__func__,
"Volume TOP not found in %s\n", geo_file_name);
148 Fatal(__func__,
"Unexpected geometry %s\n", geo_file_name);
156 Fatal(__func__,
"Expected ecal node 1 with 504 daughters or less in %s\n", geo_file_name);
161 if (ch < 1 || ch > 504) {
162 Fatal(__func__,
"Unexpected chan=%d at ecal node 1 in %s\n", ch, geo_file_name);
173 Fatal(__func__,
"Expected ecal node 2 with 504 daughters or less in %s\n", geo_file_name);
178 if (ch < 505 || ch > 1008) {
179 Fatal(__func__,
"Unexpected chan=%d at ecal node 2 in %s\n", ch, geo_file_name);
221 if (pedestal < fPedestal.min || pedestal >
fPedestal.max)
235 }
else if (min_v ==
v) {
241 y = (y - pedestal) * scale;
245 if (min_v >
fSignal.max || min_n - min_cnt < fSignal.sample0 || min_n >
fSignal.sample0 +
fSignal.samples) {
254 while (min_cnt-- > 0) {
258 graph.
Fit(
"Novosibirsk",
"QR0",
"");
260 if (!
gMinuit->fCstatu.EqualTo(
"CONVERGED "))
279 To = To - 0.5 * Vp / dVdT;
303 Double_t arg = 1.0 - (x[0] - peak) * tail / width;
308 static const Double_t xi = 2.3548200450309494;
310 Double_t width_zero2 = width_zero * width_zero;
311 Double_t exponent = (-0.5 / (width_zero2)*
log *
log) - (width_zero2 * 0.5);
void Info(const char *location, const char *msgfmt,...)
void Error(const char *location, const char *msgfmt,...)
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TMinuit * gMinuit
uint32_t GetSerial() const
vector< IntType > & GetValue()
uint16_t GetChannel() const
void Set(BmnECALMapElement *e, Float_t amp=0., Float_t peakAmp=0., Float_t startTime=0., Float_t peakTime=0.)
struct BmnECALRaw2Digit::@112334167373002213270221073046060023217272110234 fSignal
static Double_t Novosibirsk(Double_t *x, Double_t *p)
void FillEvent(TClonesArray *data, TClonesArray *ecaldigit)
Bool_t UseNovosibirskFit(BmnADCDigit< Short_t > *digit, Int_t chan, TClonesArray *ecaldigit)
struct BmnECALRaw2Digit::@112334167373002213270221073046060023217272110234 fPedestal
Bool_t LoadCalibration(const char *calibr_file_name)
BmnECALMapElement fECALMapArray[MAX_ECAL_CHANNELS+1]
Bool_t LoadGeometry(const char *geo_file_name)
Bool_t LoadAdcMap(const char *map_file_name)
TObject * ConstructedAt(Int_t idx)
virtual Double_t GetMinimumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
virtual Double_t GetMinimum(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
virtual Double_t Derivative(Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
virtual Double_t GetX(Double_t y, Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
virtual void SetParameters(const Double_t *params)
Int_t GetNdaughters() const
TGeoNode * GetDaughter(Int_t ind) const
TGeoNode * GetNode(const char *name) const
static TGeoVolume * Import(const char *filename, const char *name="", Option_t *option="")
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
TF1 * GetFunction(const char *name) const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
virtual Int_t RemovePoint()
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
const char * Data() const
static TString Format(const char *fmt,...)
RVec< PromoteType< T > > log(const RVec< T > &v)
#define MAX_ECAL_CHANNELS
*brief user defined string literal for JSON values *sa std::size_t n
Double_t Power(Double_t x, Double_t y)