Technical fix: reducing the virtual memory consumption
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Oct 2009 20:01:37 +0000 (20:01 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Oct 2009 20:01:37 +0000 (20:01 +0000)
TPC/AliTPCQADataMakerRec.cxx
TPC/AliTPCdataQA.cxx
VZERO/AliVZEROQADataMakerRec.cxx

index 765658e..1188adc 100644 (file)
@@ -442,24 +442,25 @@ void AliTPCQADataMakerRec::MakeDigits(TTree* digitTree)
 void AliTPCQADataMakerRec::MakeRecPoints(TTree* recTree)
 {
 
-  AliTPCClustersRow *clrow = new AliTPCClustersRow();
-  clrow->SetClass("AliTPCclusterMI");
-  clrow->SetArray(0);
-  clrow->GetArray()->ExpandCreateFast(10000);
-
+  AliTPCClustersRow clrow;
+  clrow.SetClass("AliTPCclusterMI");
+  clrow.SetArray(0);
+  clrow.GetArray()->ExpandCreateFast(10000);
+  AliTPCClustersRow * pclrow = &clrow;
   TBranch* branch = recTree->GetBranch("Segment");
-  branch->SetAddress(&clrow);
+  
+  branch->SetAddress(&pclrow);
 
   const Int_t nEntries = Int_t(recTree->GetEntries());
   for (Int_t i = 0; i < nEntries; i++) {
     
     branch->GetEntry(i);
     
-    const Int_t nClusters = clrow->GetArray()->GetEntriesFast();
+    const Int_t nClusters = clrow.GetArray()->GetEntriesFast();
     for (Int_t icl=0; icl < nClusters; icl++){
       
       AliTPCclusterMI* cluster = 
-       (AliTPCclusterMI*)clrow->GetArray()->At(icl);
+       (AliTPCclusterMI*)clrow.GetArray()->At(icl);
       
       Float_t Qmax = cluster->GetMax();
       Float_t Q    = cluster->GetQ();
@@ -486,7 +487,6 @@ void AliTPCQADataMakerRec::MakeRecPoints(TTree* recTree)
     } // end loop over clusters
   } // end loop over tree
 
-  delete clrow;
 }
 
 //____________________________________________________________________________
index 203d40d..bfaf56c 100644 (file)
@@ -383,9 +383,8 @@ Bool_t AliTPCdataQA::ProcessEvent(AliRawReader *rawReader)
   //
   //  Event processing loop - AliRawReader
   //
-  AliTPCRawStreamV3 *rawStreamV3 = new AliTPCRawStreamV3(rawReader, (AliAltroMapping**)fMapping);
-  Bool_t res=ProcessEvent(rawStreamV3);
-  delete rawStreamV3;
+  AliTPCRawStreamV3 rawStreamV3(rawReader, (AliAltroMapping**)fMapping);
+  Bool_t res=ProcessEvent(&rawStreamV3);
   if(res)
     fEventCounter++; // only increment event counter if there is TPC data
   return res;
@@ -439,13 +438,12 @@ Bool_t AliTPCdataQA::ProcessEventFast(AliRawReader *rawReader)
   //
   //  Event processing loop - AliRawReader
   //
-  AliTPCRawStreamFast *rawStreamFast = new AliTPCRawStreamFast(rawReader, (AliAltroMapping**)fMapping);
-  Bool_t res=ProcessEventFast(rawStreamFast);
+  AliTPCRawStreamFast rawStreamFast(rawReader, (AliAltroMapping**)fMapping);
+  Bool_t res=ProcessEventFast(&rawStreamFast);
   if(res)
     fEventCounter++; // only increment event counter if there is TPC data
                      // otherwise Analyse (called in QA) fails
 
-  delete rawStreamFast;
   return res;
 }
 
@@ -519,9 +517,8 @@ Bool_t AliTPCdataQA::ProcessEvent(eventHeaderStruct *event)
   //  process date event
   //
 
-  AliRawReader *rawReader = new AliRawReaderDate((void*)event);
-  Bool_t result=ProcessEvent(rawReader);
-  delete rawReader;
+  AliRawReaderDate rawReader((void*)event);
+  Bool_t result=ProcessEvent(&rawReader);
   return result;
 }
 
index 5d944f6..20afb86 100644 (file)
@@ -584,8 +584,8 @@ void AliVZEROQADataMakerRec::MakeESDs(AliESDEvent * esd)
      InitRaws() ;
 
    rawReader->Reset() ; 
-  AliVZERORawStream* rawStream  = new AliVZERORawStream(rawReader); 
if(!(rawStream->Next())) return;  
+   AliVZERORawStream rawStream(rawReader); 
  if(!(rawStream.Next())) return;  
  
   eventTypeType eventType = rawReader->GetType();
 
@@ -621,18 +621,18 @@ void AliVZEROQADataMakerRec::MakeESDs(AliESDEvent * esd)
 
        for(Int_t iChannel=0; iChannel<64; iChannel++) { // BEGIN : Loop over channels
                   
-          offlineCh = rawStream->GetOfflineChannel(iChannel);
+          offlineCh = rawStream.GetOfflineChannel(iChannel);
                   
           // Fill Pedestal histograms
           
            for(Int_t j=15; j<21; j++) {
-                      if((rawStream->GetBGFlag(iChannel,j) || rawStream->GetBBFlag(iChannel,j))) iFlag++;
+                      if((rawStream.GetBGFlag(iChannel,j) || rawStream.GetBBFlag(iChannel,j))) iFlag++;
            }
 
            if(iFlag == 0){ //No Flag found
                       for(Int_t j=15; j<21; j++){
-                              pedestal=rawStream->GetPedestal(iChannel, j);
-                              integrator = rawStream->GetIntegratorFlag(iChannel, j);
+                              pedestal=rawStream.GetPedestal(iChannel, j);
+                              integrator = rawStream.GetIntegratorFlag(iChannel, j);
 
                               GetRawsData((integrator == 0 ? kPedestalInt0 : kPedestalInt1))->Fill(offlineCh,pedestal);
                               GetRawsData((integrator == 0 ? kPedestalCycleInt0 : kPedestalCycleInt1))->Fill(offlineCh,pedestal);
@@ -646,16 +646,16 @@ void AliVZEROQADataMakerRec::MakeESDs(AliESDEvent * esd)
            Int_t iClock  = 0;
            Float_t iCharge = 0;
            for(Int_t iEvent=0; iEvent<21; iEvent++){
-               iCharge = rawStream->GetPedestal(iChannel,iEvent);
+               iCharge = rawStream.GetPedestal(iChannel,iEvent);
                if(iCharge>charge)  {
                       charge = iCharge;
                       iClock = iEvent;
                   }
            }   // End of maximum searching procedure
 
-           integrator    = rawStream->GetIntegratorFlag(iChannel,iClock);
-           BBFlag       = rawStream->GetBBFlag(iChannel, iClock);
-           BGFlag       = rawStream->GetBGFlag(iChannel,iClock );
+           integrator    = rawStream.GetIntegratorFlag(iChannel,iClock);
+           BBFlag       = rawStream.GetBBFlag(iChannel, iClock);
+           BGFlag       = rawStream.GetBGFlag(iChannel,iClock );
 
            GetRawsData((integrator == 0 ? kChargeEoIInt0 : kChargeEoIInt1))->Fill(offlineCh,charge);
           if(BBFlag) GetRawsData((integrator == 0 ? kChargeEoIBBInt0 : kChargeEoIBBInt1))->Fill(offlineCh,charge);
@@ -694,10 +694,10 @@ void AliVZEROQADataMakerRec::MakeESDs(AliESDEvent * esd)
                   
           int idx;
           for(Int_t iBunch=0; iBunch<10; iBunch++){
-                          integrator = rawStream->GetIntMBFlag(iChannel, iBunch);
-                          BBFlag     = rawStream->GetBBMBFlag(iChannel, iBunch);
-                          BGFlag     = rawStream->GetBGMBFlag(iChannel, iBunch);
-                          MBCharge   = rawStream->GetChargeMB(iChannel, iBunch);
+                          integrator = rawStream.GetIntMBFlag(iChannel, iBunch);
+                          BBFlag     = rawStream.GetBBMBFlag(iChannel, iBunch);
+                          BGFlag     = rawStream.GetBGMBFlag(iChannel, iBunch);
+                          MBCharge   = rawStream.GetChargeMB(iChannel, iBunch);
 
                           if(integrator==0){
                                   if(BBFlag==0){
@@ -721,10 +721,10 @@ void AliVZEROQADataMakerRec::MakeESDs(AliESDEvent * esd)
 
          // Fill HPTDC Time Histograms
 
-          BBFlag   = rawStream->GetBBFlag(iChannel, 10);
-           BGFlag   = rawStream->GetBGFlag(iChannel, 10);
-           time     = rawStream->GetTime(iChannel);
-           width    = rawStream->GetWidth(iChannel);
+          BBFlag   = rawStream.GetBBFlag(iChannel, 10);
+           BGFlag   = rawStream.GetBGFlag(iChannel, 10);
+           time     = rawStream.GetTime(iChannel);
+           width    = rawStream.GetWidth(iChannel);
 
           if(time>0.){
                      if (offlineCh<32) {
@@ -749,10 +749,10 @@ void AliVZEROQADataMakerRec::MakeESDs(AliESDEvent * esd)
           // Fill Flag and Charge Versus LHC-Clock histograms
           
           for(Int_t iEvent=0; iEvent<21; iEvent++){
-               charge = rawStream->GetPedestal(iChannel,iEvent);
-               integrator = rawStream->GetIntegratorFlag(iChannel,iEvent);
-               BBFlag    = rawStream->GetBBFlag(iChannel, iEvent);
-               BGFlag    = rawStream->GetBGFlag(iChannel,iEvent );
+               charge = rawStream.GetPedestal(iChannel,iEvent);
+               integrator = rawStream.GetIntegratorFlag(iChannel,iEvent);
+               BBFlag    = rawStream.GetBBFlag(iChannel, iEvent);
+               BGFlag    = rawStream.GetBGFlag(iChannel,iEvent );
 
                ((TH2*) GetRawsData((integrator == 0 ? kChargeVsClockInt0 : kChargeVsClockInt1 )))->Fill(offlineCh,(float)iEvent-10,(float)charge);
                ((TH2*) GetRawsData(kBBFlagVsClock))->Fill(offlineCh,(float)iEvent-10,(float)BBFlag);
@@ -820,8 +820,6 @@ void AliVZEROQADataMakerRec::MakeESDs(AliESDEvent * esd)
        p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kDiffTime)->GetName()))) ; 
        if (p) p->SetVal((double)diffTime) ;                     
        
-       delete rawStream; rawStream = 0x0;      
-
 
  }