SDD DA updated: baseline equalized to 20 for each hybrid. Added Carlos thresholds...
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSDDCMN.cxx
index 62f4accc9c762e1e0bf23ef9efc0cdf9053bdd37..f31d5e95126e6b42a79eaac5b8e99c766dbbb069 100644 (file)
@@ -30,7 +30,7 @@
 
 ClassImp(AliITSOnlineSDDCMN)
 //______________________________________________________________________
-  AliITSOnlineSDDCMN::AliITSOnlineSDDCMN():AliITSOnlineSDD(),fNEvents(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.)
+  AliITSOnlineSDDCMN::AliITSOnlineSDDCMN():AliITSOnlineSDD(),fNEvents(0),fLowThreshold(0),fHighThreshold(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.)
 {
   // default constructor
   Reset();
@@ -39,7 +39,7 @@ ClassImp(AliITSOnlineSDDCMN)
   SetNSigmaNoise();
 }
 //______________________________________________________________________
-  AliITSOnlineSDDCMN::AliITSOnlineSDDCMN(Int_t nddl, Int_t ncarlos, Int_t sid):AliITSOnlineSDD(nddl,ncarlos,sid),fNEvents(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.)
+  AliITSOnlineSDDCMN::AliITSOnlineSDDCMN(Int_t nddl, Int_t ncarlos, Int_t sid):AliITSOnlineSDD(nddl,ncarlos,sid),fNEvents(0),fLowThreshold(0),fHighThreshold(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.)
 {
   // default constructor
   Reset();
@@ -71,7 +71,7 @@ void AliITSOnlineSDDCMN::ReadBaselines(){
   sprintf(basfilnam,"SDDbase_step1_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
   FILE* basf=fopen(basfilnam,"r");
   if(basf==0){
-    AliWarning("Baseline file not present, Set all baselines to 50\n");
+    AliWarning(Form("Baseline file not present (ddl %d  carlos %d side %d, Set all baselines to 50\n",fDDL,fCarlos,fSide));
     for(Int_t ian=0;ian<fgkNAnodes;ian++){ 
       fBaseline[ian]=50.;
       fEqBaseline[ian]=50;
@@ -80,6 +80,8 @@ void AliITSOnlineSDDCMN::ReadBaselines(){
     }
     return;
   }
+  fscanf(basf,"%d\n",&fHighThreshold);
+  fscanf(basf,"%d\n",&fLowThreshold);
   Int_t n,ok,eqbase,offbase;
   Float_t base,rms,cmn,corrnoi;
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
@@ -161,6 +163,8 @@ void AliITSOnlineSDDCMN::WriteToASCII(){
   Char_t outfilnam[100];
   sprintf(outfilnam,"SDDbase_step2_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
   FILE* outf=fopen(outfilnam,"w");
+  fprintf(outf,"%d\n",fHighThreshold);
+  fprintf(outf,"%d\n",fLowThreshold);
   for(Int_t ian=0;ian<fgkNAnodes;ian++){
     fprintf(outf,"%d %d %8.3f %d %d %8.3f %8.3f %8.3f\n",ian,IsAnodeGood(ian),GetAnodeBaseline(ian),GetAnodeEqualizedBaseline(ian),GetAnodeBaselineOffset(ian),GetAnodeRawNoise(ian),GetAnodeCommonMode(ian),GetAnodeCorrNoise(ian));
   }