]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding the trigger charge and bits to the reco chain. Bumping the qa datamaker class...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 12 Oct 2011 13:51:31 +0000 (13:51 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 12 Oct 2011 13:51:31 +0000 (13:51 +0000)
VZERO/AliVZEROQADataMakerRec.h
VZERO/AliVZEROReconstructor.cxx
VZERO/AliVZEROReconstructor.h

index 961838099b08cc75b0384d75e37ef51b0d52f774..579986f1beecb8867dfef372853b6e4b48c2aa6e 100644 (file)
@@ -82,7 +82,7 @@ private:
   Float_t            fTimeOffset[64]; //! HPTDC time offsets channel by channel
   TF1*               fTimeSlewing;    //! Function for time slewing correction
 
-  ClassDef(AliVZEROQADataMakerRec,3)  // description 
+  ClassDef(AliVZEROQADataMakerRec,4)  // description 
 
 };
 
index cace640eb51ffabb757a451ec363ffa043e05f6a..191939521bd758930750a153fa4b74c76c41de9a 100644 (file)
@@ -52,6 +52,7 @@ AliVZEROReconstructor:: AliVZEROReconstructor(): AliReconstructor(),
                         fESD(0x0),
                         fESDVZEROfriend(0x0),
                         fCalibData(NULL),
+                        fTriggerData(NULL),
                         fTimeSlewing(NULL),
                         fSaturationCorr(NULL),
                         fCollisionMode(0),
@@ -99,6 +100,10 @@ AliVZEROReconstructor:: AliVZEROReconstructor(): AliReconstructor(),
   AliCDBEntry *entry5 =  AliCDBManager::Instance()->Get("VZERO/Calib/Saturation");
   if (!entry5) AliFatal("Saturation entry is not found in OCDB !");
   fSaturationCorr = (TObjArray*)entry5->GetObject();
+
+  AliCDBEntry *entry6 = AliCDBManager::Instance()->Get("VZERO/Trigger/Data");
+  if (!entry6) AliFatal("VZERO trigger config data is not found in OCDB !");
+  fTriggerData = (AliVZEROTriggerData*)entry6->GetObject();
 }
 
 
@@ -206,6 +211,7 @@ void AliVZEROReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits
     }  
 
     // Filling the global part of esd friend object that is available only for raw data
+    rawStream.FillTriggerBits(fTriggerData);
     fESDVZEROfriend->SetTriggerInputs(rawStream.GetTriggerInputs());
     fESDVZEROfriend->SetTriggerInputsMask(rawStream.GetTriggerInputsMask());
 
@@ -221,6 +227,12 @@ void AliVZEROReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits
     digitsTree->GetUserInfo()->Add(new TParameter<int>("BGflagsV0A",aBGflagsV0A));
     digitsTree->GetUserInfo()->Add(new TParameter<int>("BGflagsV0C",aBGflagsV0C));
 
+    UShort_t chargeA,chargeC;
+    rawStream.CalculateChargeForCentrTriggers(fTriggerData,chargeA,chargeC);
+    digitsTree->GetUserInfo()->Add(new TParameter<int>("ChargeA",(Int_t)chargeA));
+    digitsTree->GetUserInfo()->Add(new TParameter<int>("ChargeC",(Int_t)chargeC));
+    digitsTree->GetUserInfo()->Add(new TParameter<int>("TriggerInputs",(Int_t)rawStream.GetTriggerInputs()));
+
     digitsTree->Fill();
   }
 
@@ -265,27 +277,35 @@ void AliVZEROReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,
   if (digitsTree->GetUserInfo()->FindObject("BBflagsV0A")) {
     aBBflagsV0A = ((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("BBflagsV0A"))->GetVal();
   }
-  else
-    AliWarning("V0A beam-beam flags not found in digits tree UserInfo! The flags will not be written to the raw-data stream!");
+  else {
+    if (esd && (esd->GetEventType() == 7))
+      AliWarning("V0A beam-beam flags not found in digits tree UserInfo!");
+  }
 
   if (digitsTree->GetUserInfo()->FindObject("BBflagsV0C")) {
     aBBflagsV0C = ((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("BBflagsV0C"))->GetVal();
   }
-  else
-    AliWarning("V0C beam-beam flags not found in digits tree UserInfo! The flags will not be written to the raw-data stream!");
+  else {
+    if (esd && (esd->GetEventType() == 7))
+      AliWarning("V0C beam-beam flags not found in digits tree UserInfo!");
+  }
 
   if (digitsTree->GetUserInfo()->FindObject("BGflagsV0A")) {
     aBGflagsV0A = ((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("BGflagsV0A"))->GetVal();
   }
-  else
-    AliWarning("V0A beam-gas flags not found in digits tree UserInfo! The flags will not be written to the raw-data stream!");
+  else {
+    if (esd && (esd->GetEventType() == 7))
+      AliWarning("V0A beam-gas flags not found in digits tree UserInfo!");
+  }
 
   if (digitsTree->GetUserInfo()->FindObject("BGflagsV0C")) {
     aBGflagsV0C = ((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("BGflagsV0C"))->GetVal();
   }
-  else
-    AliWarning("V0C beam-gas flags not found in digits tree UserInfo! The flags will not be written to the raw-data stream!");
-  
+  else {
+    if (esd && (esd->GetEventType() == 7))
+      AliWarning("V0C beam-gas flags not found in digits tree UserInfo!");
+  }
+
   // Beam-beam and beam-gas flags (hardware)
   for (Int_t iChannel = 0; iChannel < 64; ++iChannel) {
     if(iChannel < 32) {
@@ -298,6 +318,34 @@ void AliVZEROReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,
     }
   }
 
+  // Fill the trigger charges and bits
+  UShort_t chargeA = 0;
+  UShort_t chargeC = 0;
+  UShort_t triggerInputs = 0;
+  if (digitsTree->GetUserInfo()->FindObject("ChargeA")) {
+    chargeA = (UShort_t)(((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("ChargeA"))->GetVal());
+  }
+  else {
+    if (esd && (esd->GetEventType() == 7))
+      AliWarning("V0A trigger charge not found in digits tree UserInfo!");
+  }
+
+  if (digitsTree->GetUserInfo()->FindObject("ChargeC")) {
+    chargeC = (UShort_t)(((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("ChargeC"))->GetVal());
+  }
+  else {
+    if (esd && (esd->GetEventType() == 7))
+      AliWarning("V0C trigger charge not found in digits tree UserInfo!");
+  }
+
+  if (digitsTree->GetUserInfo()->FindObject("TriggerInputs")) {
+    triggerInputs = (UShort_t)(((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("TriggerInputs"))->GetVal());
+  }
+  else {
+    if (esd && (esd->GetEventType() == 7))
+      AliWarning("V0C trigger charge not found in digits tree UserInfo!");
+  }
+
   Int_t nEntries = (Int_t)digitsTree->GetEntries();
   for (Int_t e=0; e<nEntries; e++) {
     digitsTree->GetEvent(e);
index d653513d304345f5f1d91c27ff5e960734395ca2..7fc7a14afd2f3eed0ebe5a395fbb50888ff1bae7 100644 (file)
@@ -21,6 +21,7 @@
 
 class TF1;
 class AliVZEROCalibData;
+class AliVZEROTriggerData;
 class AliESDEvent;
 class AliESDVZEROfriend;
 
@@ -69,6 +70,7 @@ private:
   AliVZEROReconstructor& operator = (const AliVZEROReconstructor& reconstructor);
   
   AliVZEROCalibData* fCalibData;      //! calibration data
+  AliVZEROTriggerData* fTriggerData;    //! calibration data
   Float_t            fTimeOffset[64]; //! HPTDC time offsets channel by channel
   TF1*               fTimeSlewing;    //! Function for time slewing correction
   TObjArray*         fSaturationCorr; //! Array with functions for correcting the signal saturation
@@ -78,7 +80,7 @@ private:
 
   mutable TClonesArray *fDigitsArray; // clones-array for ConvertDigits() and FillESD()
 
-  ClassDef(AliVZEROReconstructor, 3)  // class for the VZERO reconstruction
+  ClassDef(AliVZEROReconstructor, 4)  // class for the VZERO reconstruction
 };
 
 #endif