Skip to content

Commit

Permalink
Changes for #92625: please port EMCal DA update to release (to be dep…
Browse files Browse the repository at this point in the history
…loyed at P2). From rev. 55177
  • Loading branch information
hristov committed Mar 15, 2012
1 parent a2d1a50 commit c794f7f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 11 additions & 1 deletion EMCAL/AliCaloCalibSignal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ AliCaloCalibSignal::AliCaloCalibSignal(kDetType detectorType) :
fLatestHour(0),
fUseAverage(kTRUE),
fSecInAverage(1800),
fDownscale(10),
fNEvents(0),
fNAcceptedEvents(0),
fTreeAmpVsTime(NULL),
Expand Down Expand Up @@ -153,6 +154,7 @@ void AliCaloCalibSignal::DeleteTrees()
// fLatestHour(sig.GetLatestHour()),
// fUseAverage(sig.GetUseAverage()),
// fSecInAverage(sig.GetSecInAverage()),
// fDownscale(sig.GetDownscale()),
// fNEvents(sig.GetNEvents()),
// fNAcceptedEvents(sig.GetNAcceptedEvents()),
// fTreeAmpVsTime(),
Expand Down Expand Up @@ -369,7 +371,8 @@ void AliCaloCalibSignal::SetParametersFromFile(const char *parameterFile)

// if the key matches with something we expect, we assign the new value
if ( (key == "fAmpCut") || (key == "fReqFractionAboveAmpCutVal") ||
(key == "fAmpCutLEDRef") || (key == "fSecInAverage") ) {
(key == "fAmpCutLEDRef") || (key == "fSecInAverage") ||
(key == "fDownscale") ) {
istringstream iss(value);
printf("AliCaloCalibSignal::SetParametersFromFile - key %s value %s\n", key.c_str(), value.c_str());

Expand All @@ -385,6 +388,9 @@ void AliCaloCalibSignal::SetParametersFromFile(const char *parameterFile)
else if (key == "fSecInAverage") {
iss >> fSecInAverage;
}
else if (key == "fDownscale") {
iss >> fDownscale;
}
} // some match found/expected

}
Expand All @@ -404,6 +410,7 @@ void AliCaloCalibSignal::WriteParametersToFile(const char *parameterFile)
out << "fReqFractionAboveAmpCutVal" << "::" << fReqFractionAboveAmpCutVal << endl;
out << "fAmpCutLEDRef" << "::" << fAmpCutLEDRef << endl;
out << "fSecInAverage" << "::" << fSecInAverage << endl;
out << "fDownscale" << "::" << fDownscale << endl;

out.close();
return;
Expand Down Expand Up @@ -485,6 +492,7 @@ Bool_t AliCaloCalibSignal::AddInfo(const AliCaloCalibSignal *sig)
fLatestHour = sig->GetLatestHour();
fUseAverage = sig->GetUseAverage();
fSecInAverage = sig->GetSecInAverage();
fDownscale = sig->GetDownscale();
fNEvents = sig->GetNEvents();
fNAcceptedEvents = sig->GetNAcceptedEvents();

Expand All @@ -510,6 +518,8 @@ Bool_t AliCaloCalibSignal::ProcessEvent(AliCaloRawStreamV3 *in, UInt_t Timestamp

fNEvents++; // one more event

if ( (fNEvents%fDownscale)!=0 ) return kFALSE; // mechanism to skip some of the input events, if we want

// use maximum numbers to set array sizes
int iAmpValHighGain[fgkMaxTowers];
int iAmpValLowGain[fgkMaxTowers];
Expand Down
7 changes: 6 additions & 1 deletion EMCAL/AliCaloCalibSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ class AliCaloCalibSignal : public TObject {
void SetSecInAverage(int secInAverage) {fSecInAverage = secInAverage;}; // length of the interval that should be used for the average calculation (determines number of bins in TProfile)
int GetSecInAverage() const {return fSecInAverage;}; //!

void SetDownscale(int i) {fDownscale = i;}; //!
int GetDownscale() const {return fDownscale;}; //!

// Info on time since start of run
double GetHour() const { return fHour; }; // time info for current event
double GetCurrentHour() const { return fHour; }; // time info for current event (same as GetHour(), just more explicitly named)
Expand Down Expand Up @@ -180,6 +183,8 @@ class AliCaloCalibSignal : public TObject {
bool fUseAverage; // flag to average graph points into over a time interval
int fSecInAverage; // time interval for the graph averaging

int fDownscale; // to select 1 out every N (fDownscale) events

// status counters
int fNEvents; // # events processed
int fNAcceptedEvents; // # events accepted
Expand Down Expand Up @@ -209,7 +214,7 @@ class AliCaloCalibSignal : public TObject {
int fNLowGain[fgkMaxTowers]; // same, for low gain
int fNRef[fgkMaxRefs * 2]; // same, for LED refs; *2 for both gains

ClassDef(AliCaloCalibSignal, 6) // don't forget to change version if you change class member list..
ClassDef(AliCaloCalibSignal, 7) // don't forget to change version if you change class member list..

};

Expand Down

0 comments on commit c794f7f

Please sign in to comment.