Changed scope for AliTOFRawStream variable. It solves the problem with some TClonesAr...
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 16 Oct 2010 09:39:33 +0000 (09:39 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 16 Oct 2010 09:39:33 +0000 (09:39 +0000)
TOF/AliTOFQADataMaker.cxx
TOF/AliTOFQADataMaker.h
TOF/AliTOFQADataMakerRec.cxx
TOF/AliTOFQADataMakerRec.h

index 6f459e2..42448d1 100644 (file)
@@ -43,7 +43,8 @@ ClassImp(AliTOFQADataMaker)
            
 //____________________________________________________________________________ 
   AliTOFQADataMaker::AliTOFQADataMaker() : 
-  AliQADataMaker(AliQAv1::GetDetName(AliQAv1::kTOF), "TOF Quality Assurance Data Maker")
+  AliQADataMaker(AliQAv1::GetDetName(AliQAv1::kTOF), "TOF Quality Assurance Data Maker"),
+    fTOFRawStream(AliTOFRawStream())
 {
   //
   // ctor
@@ -52,7 +53,8 @@ ClassImp(AliTOFQADataMaker)
 
 //____________________________________________________________________________ 
 AliTOFQADataMaker::AliTOFQADataMaker(const AliTOFQADataMaker& qadm) :
-  AliQADataMaker()
+  AliQADataMaker(),
+  fTOFRawStream(AliTOFRawStream(qadm.fTOFRawStream))
 {
   //
   //copy ctor 
@@ -472,11 +474,12 @@ void AliTOFQADataMaker::MakeRaws(AliRawReader* rawReader)
   Int_t out[5];
 
   TClonesArray * clonesRawData;
-  AliTOFRawStream tofInput(rawReader);
+  //AliTOFRawStream tofInput(rawReader);
+  fTOFRawStream.SetRawReader(rawReader);
   for (Int_t iDDL = 0; iDDL < AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); iDDL++){
     rawReader->Reset();
-    tofInput.LoadRawData(iDDL);
-    clonesRawData = (TClonesArray*)tofInput.GetRawData();
+    fTOFRawStream.LoadRawData(iDDL);
+    clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData();
     for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) {
       AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
       //if (!tofRawDatum->GetTOT() || !tofRawDatum->GetTOF()) continue;
@@ -485,12 +488,12 @@ void AliTOFQADataMaker::MakeRaws(AliRawReader* rawReader)
       GetRawsData(1)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
       GetRawsData(2)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns
 
-      tofInput.EquipmentId2VolumeId(iDDL, 
-                                   tofRawDatum->GetTRM(), 
-                                   tofRawDatum->GetTRMchain(),
-                                   tofRawDatum->GetTDC(), 
-                                   tofRawDatum->GetTDCchannel(), 
-                                   in);
+      fTOFRawStream.EquipmentId2VolumeId(iDDL, 
+                                        tofRawDatum->GetTRM(), 
+                                        tofRawDatum->GetTRMchain(),
+                                        tofRawDatum->GetTDC(), 
+                                        tofRawDatum->GetTDCchannel(), 
+                                        in);
     
       GetMapIndeces(in,out);
       GetRawsData(3)->Fill( out[0],out[1]) ;//raw map
@@ -501,6 +504,8 @@ void AliTOFQADataMaker::MakeRaws(AliRawReader* rawReader)
     
   } // DDL Loop
   
+  fTOFRawStream.Clear();
+
   Int_t nentries=ntof;
   if(nentries<=0){
     GetRawsData(0)->Fill(-1.) ; 
index 525ff6c..7b26d08 100644 (file)
@@ -41,7 +41,9 @@ private:
   virtual void   EndOfDetectorCycle(AliQAv1::TASKINDEX task, TObjArray * list) ;
   virtual void   GetMapIndeces(Int_t *in, Int_t *out) ; 
 
-  ClassDef(AliTOFQADataMaker,1)  // description 
+  AliTOFRawStream fTOFRawStream; // AliTOFRawStream variable
+
+  ClassDef(AliTOFQADataMaker,2)  // description 
 
 };
 
index 93bd514..28a23e1 100644 (file)
@@ -86,7 +86,8 @@ ClassImp(AliTOFQADataMakerRec)
     fLineExpTimeMin(0x0),
     fLineExpTimeMax(0x0),
     fLineExpTotMin(0x0),
-    fLineExpTotMax(0x0)
+    fLineExpTotMax(0x0),
+  fTOFRawStream(AliTOFRawStream())
 {
   //
   // ctor
@@ -109,7 +110,8 @@ AliTOFQADataMakerRec::AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) :
   fLineExpTimeMin(qadm.fLineExpTimeMin),
   fLineExpTimeMax(qadm.fLineExpTimeMax),
   fLineExpTotMin(qadm.fLineExpTotMin),
-  fLineExpTotMax(qadm.fLineExpTotMax)
+  fLineExpTotMax(qadm.fLineExpTotMax),
+  fTOFRawStream(qadm.fTOFRawStream)
 {
   //
   //copy ctor 
@@ -135,6 +137,13 @@ AliTOFQADataMakerRec& AliTOFQADataMakerRec::operator = (const AliTOFQADataMakerR
 }
  
 //----------------------------------------------------------------------------
+AliTOFQADataMakerRec::~AliTOFQADataMakerRec()
+{
+
+  fTOFRawStream.Clear();
+
+}
+//----------------------------------------------------------------------------
 AliTOFChannelOnlineStatusArray* AliTOFQADataMakerRec::GetCalibData() const
 {
   //
@@ -443,16 +452,17 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
        Int_t chIndex=-1;
        
        TClonesArray * clonesRawData;
-       AliTOFRawStream tofInput(rawReader);
-       
+       //AliTOFRawStream tofInput(rawReader);
+       fTOFRawStream.SetRawReader(rawReader);
+
        //uncomment if needed to apply DeltaBC correction
-       //tofInput.ApplyBCCorrections(kTRUE);
+       //fTOFRawStream.ApplyBCCorrections(kTRUE);
        
        for (Int_t iDDL = 0; iDDL < AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); iDDL++){
            rawReader->Reset();
            
-           tofInput.LoadRawDataBuffersV2(iDDL);
-           clonesRawData = (TClonesArray*)tofInput.GetRawData();
+           fTOFRawStream.LoadRawDataBuffersV2(iDDL);
+           clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData();
            for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) {
                AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
                
@@ -465,12 +475,12 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
                    equipmentID[4]=tofRawDatum->GetTDCchannel();
                    
                    if (CheckEquipID(equipmentID)){
-                       tofInput.EquipmentId2VolumeId(iDDL, 
-                                                     tofRawDatum->GetTRM(), 
-                                                     tofRawDatum->GetTRMchain(),
-                                                     tofRawDatum->GetTDC(), 
-                                                     tofRawDatum->GetTDCchannel(), 
-                                                     volumeID);
+                       fTOFRawStream.EquipmentId2VolumeId(iDDL, 
+                                                          tofRawDatum->GetTRM(), 
+                                                          tofRawDatum->GetTRMchain(),
+                                                          tofRawDatum->GetTDC(), 
+                                                          tofRawDatum->GetTDCchannel(), 
+                                                          volumeID);
                        if (FilterSpare(equipmentID)) continue;
                        if (FilterLTMData(equipmentID)){ //counts LTM hits
                            if (tofRawDatum->GetTOT()) GetRawsData(15)->Fill(equipmentID[0]);
@@ -553,10 +563,12 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
        } // DDL Loop
        
        for (Int_t j=0;j<5;j++){
-           GetRawsData(j)->Fill(ntof[j]);
+         GetRawsData(j)->Fill(ntof[j]);
        }
        fProcessedRawEventN++;
-       
+
+       fTOFRawStream.Clear();
+
     } else {
        AliDebug(1,Form("Event of type %d found. Skipping non-physics event for QA.\n", rawReader->GetType())); 
     }
index 1cb9ae1..bfeaabd 100644 (file)
@@ -28,7 +28,7 @@ public:
   AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) ;   
   AliTOFQADataMakerRec& operator = (const AliTOFQADataMakerRec& qadm) ;
   AliTOFChannelOnlineStatusArray *GetCalibData() const;
-  virtual ~AliTOFQADataMakerRec() {;} // dtor
+  virtual ~AliTOFQADataMakerRec(); // dtor
   
 protected: 
   AliTOFChannelOnlineStatusArray * fCalibData;        //! calibration data
@@ -66,7 +66,9 @@ private:
          TLine* fLineSMid035[10];
          TLine* fLineSMid3671[10];
 
-         ClassDef(AliTOFQADataMakerRec,3)  // description 
+         AliTOFRawStream fTOFRawStream; // AliTOFRawStream variable
+
+         ClassDef(AliTOFQADataMakerRec,4)  // description 
 
 };