rootana/src/framework/LoopSequence.cpp File Reference

#include "LoopSequence.h"
#include <cmath>
#include <iomanip>
#include "Rtypes.h"
#include "EventNavigator.h"
#include "ModulesNavigator.h"
#include "BaseModule.h"
#include "AlcapExcept.h"

Go to the source code of this file.

Classes

class  module_error
class  preprocess_error
class  process_error
class  postprocess_error

Functions

void ClearGlobalData (TGlobalData *data)

Variables

SourceAnalPulseMap gAnalysedPulseMap

Function Documentation

void ClearGlobalData ( TGlobalData data  ) 

Definition at line 203 of file main.cpp.

References gAnalysedPulseMap, gDetectorPulseMap, gMuonEvents, and modules::navigator::Instance().

00204 {
00205   // TODO: this comment is now gibberish.
00206   // We could put this into TGlobalData::Clear(), but we need
00207   // to be sure that's okay at the alcapana level. That is, if
00208   // Clear() deletes the TPulseIsland objects, but g_event doesn't
00209   // own the pulses, they would be deleted later. A solution is to
00210   // be sure that TGlobalData isn't called in alcapana, or ensure
00211   // that g_event owns the pulse islands at that level.  
00212 //
00213 //---  LoopSequence::Process now takes care of this part by invoking TGlobalData::Clear
00214 //  StringPulseIslandMap::iterator mapIter;
00215 //  StringPulseIslandMap::iterator mapEnd = data->fPulseIslandToChannelMap.end();
00216 //  for(mapIter = data->fPulseIslandToChannelMap.begin(); mapIter != mapEnd; mapIter++) {
00217 //    // The iterator is pointing to a pair<string, vector<TPulseIsland*> >
00218 //    std::vector<TPulseIsland*>& pulse_vector= mapIter->second;
00219 //    for(size_t i=0; i<pulse_vector.size(); i++){
00220 //      delete pulse_vector[i];
00221 //      pulse_vector[i] = NULL;
00222 //    }
00223 //    pulse_vector.clear();
00224 //  }
00225 
00226     // we should not clear TAPs if we're loading them in from a previously made
00227     // TAP tree (which uses a TClonesArray that is responsible for deleting them )
00228     static bool should_delete_TAPS=!modules::navigator::Instance()->GetModule("LoadPulses");
00229     for(SourceAnalPulseMap::iterator mapIter=gAnalysedPulseMap.begin();
00230             mapIter != gAnalysedPulseMap.end(); ++mapIter) {
00231 
00232         // The iterator is pointing to a pair<string, vector<TPulseIsland*> >
00233         AnalysedPulseList& pulse_vector= mapIter->second;
00234         if(should_delete_TAPS){
00235             for(size_t i=0; i<pulse_vector.size(); i++){
00236                 delete pulse_vector[i];
00237                 pulse_vector[i] = NULL;
00238             }
00239         }
00240     pulse_vector.clear();
00241   }
00242   //  gAnalysedPulseMap.clear();
00243 
00244   for(SourceDetPulseMap::iterator mapIter = gDetectorPulseMap.begin();
00245           mapIter != gDetectorPulseMap.end(); ++mapIter) {
00246     // The iterator is pointing to a pair<string, vector<TPulseIsland*> >
00247     DetectorPulseList& pulse_vector= mapIter->second;
00248     for(size_t i=0; i<pulse_vector.size(); i++){
00249       delete pulse_vector[i];
00250       pulse_vector[i] = NULL;
00251     }
00252     pulse_vector.clear();
00253   }
00254   //gDetectorPulseMap.clear();
00255 
00256   for(MuonEventList::iterator muonEvent = gMuonEvents.begin();
00257           muonEvent != gMuonEvents.end(); ++muonEvent) {
00258       delete *muonEvent;
00259   }
00260   gMuonEvents.clear();
00261 }


Variable Documentation


Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1