#include "EventNavigator.h"
#include <iostream>
#include <string>
#include <cmath>
#include "TFile.h"
#include "TTree.h"
#include "format.h"
#include "SetupRecord.h"
#include "BankBranch.h"
#include "TPulseIsland.h"
#include "TAnalysedPulse.h"
#include "TDetectorPulse.h"
#include "TMuonEvent.h"
#include "debug_tools.h"
#include "CommandLine.h"
Go to the source code of this file.
Functions | |
template<typename T , unsigned int & I> | |
T | ADV (T t) |
void | ClearGlobalData (TGlobalData *data) |
T ADV | ( | T | t | ) | [inline] |
Definition at line 210 of file EventNavigator.cpp.
00210 { 00211 if (I == 0) return t; 00212 return ADV<T,I-1>(++t); 00213 };
void ClearGlobalData | ( | TGlobalData * | data | ) |
Definition at line 203 of file main.cpp.
Referenced by LoopSequence::Process().
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 }