]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
add possibility to downscale input to AliCaloCalibSignal (used in LED DA)
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Mar 2012 14:50:05 +0000 (14:50 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Mar 2012 14:50:05 +0000 (14:50 +0000)
EMCAL/AliCaloCalibSignal.cxx
EMCAL/AliCaloCalibSignal.h

index ddefc5f173ccde1fcfae91fe2dbd0524bc4c90f1..4f2d2020496a48efb90f920a99b92866f8faf50a 100644 (file)
@@ -76,6 +76,7 @@ AliCaloCalibSignal::AliCaloCalibSignal(kDetType detectorType) :
   fLatestHour(0),
   fUseAverage(kTRUE),
   fSecInAverage(1800), 
+  fDownscale(10), 
   fNEvents(0),
   fNAcceptedEvents(0),
   fTreeAmpVsTime(NULL),
@@ -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(),
@@ -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());
 
@@ -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
 
     }          
@@ -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;
@@ -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();
 
@@ -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];
index bcba08f118a4458282946ddbd978b85e4278a565..1c482682e9816e5c939ceff73cb560db3c11141c 100644 (file)
@@ -126,6 +126,9 @@ public:
   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)
@@ -180,6 +183,8 @@ public:
   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
@@ -209,7 +214,7 @@ public:
   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..
     
 };