fLatestHour(0),
fUseAverage(kTRUE),
fSecInAverage(1800),
+ fDownscale(10),
fNEvents(0),
fNAcceptedEvents(0),
fTreeAmpVsTime(NULL),
// copy ctor
//_____________________________________________________________________
-AliCaloCalibSignal::AliCaloCalibSignal(const AliCaloCalibSignal &sig) :
- TObject(sig),
- fDetType(sig.GetDetectorType()),
- fColumns(sig.GetColumns()),
- fRows(sig.GetRows()),
- fLEDRefs(sig.GetLEDRefs()),
- fModules(sig.GetModules()),
- fCaloString(sig.GetCaloString()),
- fMapping(), //! note that we are not copying the map info
- fRunNumber(sig.GetRunNumber()),
- fStartTime(sig.GetStartTime()),
- fAmpCut(sig.GetAmpCut()),
- fReqFractionAboveAmpCutVal(sig.GetReqFractionAboveAmpCutVal()),
- fReqFractionAboveAmp(sig.GetReqFractionAboveAmp()),
- fAmpCutLEDRef(sig.GetAmpCutLEDRef()),
- fReqLEDRefAboveAmpCutVal(sig.GetReqLEDRefAboveAmpCutVal()),
- fHour(sig.GetHour()),
- fLatestHour(sig.GetLatestHour()),
- fUseAverage(sig.GetUseAverage()),
- fSecInAverage(sig.GetSecInAverage()),
- fNEvents(sig.GetNEvents()),
- fNAcceptedEvents(sig.GetNAcceptedEvents()),
- fTreeAmpVsTime(),
- fTreeAvgAmpVsTime(),
- fTreeLEDAmpVsTime(),
- fTreeLEDAvgAmpVsTime()
-{
- // also the TTree contents
- AddInfo(&sig);
- for (Int_t i = 0; i<2*fgkMaxTowers; i++) {
- if(i < fgkMaxTowers){
- fNHighGain[i] = sig.fNHighGain[i];
- fNLowGain[i] = sig.fNLowGain[i];
- }
- fNRef[i] = sig.fNRef[i];
- }
-
-
-
-}
-
+//AliCaloCalibSignal::AliCaloCalibSignal(const AliCaloCalibSignal &sig) :
+// TObject(sig),
+// fDetType(sig.GetDetectorType()),
+// fColumns(sig.GetColumns()),
+// fRows(sig.GetRows()),
+// fLEDRefs(sig.GetLEDRefs()),
+// fModules(sig.GetModules()),
+// fCaloString(sig.GetCaloString()),
+// fMapping(), //! note that we are not copying the map info
+// fRunNumber(sig.GetRunNumber()),
+// fStartTime(sig.GetStartTime()),
+// fAmpCut(sig.GetAmpCut()),
+// fReqFractionAboveAmpCutVal(sig.GetReqFractionAboveAmpCutVal()),
+// fReqFractionAboveAmp(sig.GetReqFractionAboveAmp()),
+// fAmpCutLEDRef(sig.GetAmpCutLEDRef()),
+// fReqLEDRefAboveAmpCutVal(sig.GetReqLEDRefAboveAmpCutVal()),
+// fHour(sig.GetHour()),
+// fLatestHour(sig.GetLatestHour()),
+// fUseAverage(sig.GetUseAverage()),
+// fSecInAverage(sig.GetSecInAverage()),
+// fDownscale(sig.GetDownscale()),
+// fNEvents(sig.GetNEvents()),
+// fNAcceptedEvents(sig.GetNAcceptedEvents()),
+// fTreeAmpVsTime(),
+// fTreeAvgAmpVsTime(),
+// fTreeLEDAmpVsTime(),
+// fTreeLEDAvgAmpVsTime()
+//{
+// // also the TTree contents
+// AddInfo(&sig);
+// for (Int_t i = 0; i<fgkMaxTowers; i++) {
+// fNHighGain[i] = sig.fNHighGain[i];
+// fNLowGain[i] = sig.fNLowGain[i];
+// }
+// for (Int_t i = 0; i<(2*fgkMaxRefs); i++) {
+// fNRef[i] = sig.fNRef[i];
+// }
+//
+//
+//}
+//
// assignment operator; use copy ctor to make life easy..
//_____________________________________________________________________
-AliCaloCalibSignal& AliCaloCalibSignal::operator = (const AliCaloCalibSignal &source)
-{
- // assignment operator; use copy ctor
- if (&source == this) return *this;
-
- new (this) AliCaloCalibSignal(source);
- return *this;
-}
+//AliCaloCalibSignal& AliCaloCalibSignal::operator = (const AliCaloCalibSignal &source)
+//{
+// // assignment operator; use copy ctor
+// if (&source == this) return *this;
+//
+// new (this) AliCaloCalibSignal(source);
+// return *this;
+//}
//_____________________________________________________________________
void AliCaloCalibSignal::CreateTrees()
//_____________________________________________________________________
Bool_t AliCaloCalibSignal::CheckFractionAboveAmp(const int *iAmpVal,
- int resultArray[])
+ int resultArray[]) const
{ // check fraction of towers, per column, that are above amplitude cut
Bool_t returnCode = false;
//_____________________________________________________________________
Bool_t AliCaloCalibSignal::CheckLEDRefAboveAmp(const int *iAmpVal,
- int resultArray[])
+ int resultArray[]) const
{ // check which LEDRef/Mon strips are above amplitude cut
Bool_t returnCode = false;
// 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());
else if (key == "fSecInAverage") {
iss >> fSecInAverage;
}
+ else if (key == "fDownscale") {
+ iss >> fDownscale;
+ }
} // some match found/expected
}
out << "fReqFractionAboveAmpCutVal" << "::" << fReqFractionAboveAmpCutVal << endl;
out << "fAmpCutLEDRef" << "::" << fAmpCutLEDRef << endl;
out << "fSecInAverage" << "::" << fSecInAverage << endl;
+ out << "fDownscale" << "::" << fDownscale << endl;
out.close();
return;
//_____________________________________________________________________
Bool_t AliCaloCalibSignal::AddInfo(const AliCaloCalibSignal *sig)
-{
+{
// note/FIXME: we are not yet adding correctly the info for fN{HighGain,LowGain,Ref} here - but consider this a feature for now (20080905): we'll do Analyze() unless entries were found for a tower in this original object.
// add info from sig's TTrees to ours..
fTreeLEDAvgAmpVsTime->Fill();
}
+ // We should also copy other pieces of info: counters and parameters
+ // (not number of columns and rows etc which should be the same)
+ // note that I just assign them here rather than Add them, but we
+ // normally just Add (e.g. in Preprocessor) one object so this should be fine.
+ fRunNumber = sig->GetRunNumber();
+ fStartTime = sig->GetStartTime();
+ fAmpCut = sig->GetAmpCut();
+ fReqFractionAboveAmpCutVal = sig->GetReqFractionAboveAmpCutVal();
+ fReqFractionAboveAmp = sig->GetReqFractionAboveAmp();
+ fAmpCutLEDRef = sig->GetAmpCutLEDRef();
+ fReqLEDRefAboveAmpCutVal = sig->GetReqLEDRefAboveAmpCutVal();
+ fHour = sig->GetHour();
+ fLatestHour = sig->GetLatestHour();
+ fUseAverage = sig->GetUseAverage();
+ fSecInAverage = sig->GetSecInAverage();
+ fDownscale = sig->GetDownscale();
+ fNEvents = sig->GetNEvents();
+ fNAcceptedEvents = sig->GetNAcceptedEvents();
return kTRUE;//We hopefully succesfully added info from the supplied object
}
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];
for (int gain=0; gain<2; gain++) {
fRefNum = GetRefNum(i, j, gain);
if (fNRef[fRefNum] > 0) {
- sprintf(name, "profileLEDRef%d", fRefNum);
+ snprintf(name, buffersize, "profileLEDRef%d", fRefNum);
profileLED[fRefNum] = new TProfile(name, name, numProfBins, timeMin, timeMax, "s");
}
}// gain