#include "Utilities/Configuration/interface/Architecture.h" #include "Workspace/ExRunEventInfo.h" #include "Workspace/CuTkBuilderInORCA.h" #include "CARF/G3Event/interface/G3EventProxy.h" #include // ----------------------------------------------------------------------------- // In the constructor we can initialize. It is automatically called when an // instance of the class is created. // ----------------------------------------------------------------------------- ExRunEventInfo::ExRunEventInfo() { cout << "===========================================================" << endl; cout << "=== Start create new ExRunEventInfo ===" << endl; eventsAnalysed = 0; PUeventsUsed = 0; runsAnalysed = 0; lastrun = 0; cout << "=== Done create new ExRunEventInfo ===" << endl; cout << "===========================================================" << endl; } // ----------------------------------------------------------------------------- // In the destructor we can print some summary or even fill some histogram // with results calculated. It is automatically called when an instance of // is deleted. // ----------------------------------------------------------------------------- ExRunEventInfo::~ExRunEventInfo() { cout << "===========================================================" << endl; cout << "=== Start delete ExRunEventInfo ===" << endl; cout << " Number of events analysed: " << eventsAnalysed << endl; cout << " Number of pileup events used: " << PUeventsUsed << endl; cout << " Number of runs analysed: " << runsAnalysed << endl; cout << "=== Done delete ExRunEventInfo ===" << endl; cout << "===========================================================" << endl; } // ----------------------------------------------------------------------------- // This is an example method to do the actual analysis. It gets a pointer // to an event as argument. // ----------------------------------------------------------------------------- void ExRunEventInfo::myAnalysis(G3EventProxy * ev) { // Just print the signal event number (see CARF/G3Event/interface/G3EventHeader.h) cout << "===========================================================" << endl; cout << "=== Private analysis of event #"<< ev->simSignal()->id().eventInRun() << " in run #" << ev->simSignal()->id().runNumber() << endl; if(eventsAnalysed==0){CuTkBuilderInORCA *bla=new CuTkBuilderInORCA(); bla->fill(); } eventsAnalysed++; // some statistics: count events and runs processed // And now the event numbers of all pileup events cout << "--- PileUp events are: " ; G3EventProxy::pu_range PUrange = ev->pileups(); for (G3EventProxy::pu_iterator ipu = PUrange.first; ipu != PUrange.second; ipu++) { PUeventsUsed++; // count them if (ipu != PUrange.first) { cout << ", "; } cout << (*ipu).id().eventInRun(); } cout << endl; if (ev->simSignal()->id().runNumber() != lastrun) { lastrun = (unsigned int) ev->simSignal()->id().runNumber(); runsAnalysed++; } cout << "===========================================================" << endl; };