26 #include "FairRootManager.h"
27 #include "FairRunAna.h"
28 #include "FairRuntimeDb.h"
30 #include "TClonesArray.h"
49 fDigiEnergyTresholdBarrel(0.), fDigiEnergyTresholdFWD(0.), fDigiEnergyTresholdBWD(0.), fDigiEnergyTresholdShashlyk(0.),
50 fClusterActiveTime(0.),
52 fStoreClusterBase(kTRUE)
69 FairRootManager* ioman = FairRootManager::Instance();
72 cout <<
"-E- PndEmcMakeClusterOnline::Init: " <<
"RootManager not instantiated!" << endl;
76 if(!FairRunAna::Instance()->IsTimeStamp()) {
77 cout <<
"-E- PndEmcMakeClusterOnline::Init: " <<
"This task can be activated only online" << endl;
82 fDigiArray = (TClonesArray*) ioman->GetObject(
"EmcDigiSorted");
84 cout <<
"-W- PndEmcMakeClusterOnline::Init: " <<
"No PndEmcDigi array!" << endl;
114 cout <<
"-I- PndEmcMakeClusterOnline: Intialization successfull" << endl;
140 cout<<
"Event no: " <<
evtCounter++ <<
"\tDigiList length: "<<nDigis<<endl;
151 for (Int_t iDigi=0; iDigi<nDigis; ++iDigi) {
169 cluster_A->AddLink(theDigi->GetEntryNr());
172 cluster_B->AddLink(theDigi->GetEntryNr());
179 cout <<
"incoming digi " << theDigi <<
" belongs to (is direct neighbor) cluster_A (" << cluster_A <<
")" << endl;
182 cout <<
"incoming digi " << theDigi <<
" belongs to (is direct neighbor) cluster_B (" << cluster_A <<
")" << endl;
202 for (Int_t
i=0;
i<nCluster;
i++) {
211 cout <<
"PndEmcMakeClusterOnline, Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;
219 std::vector<Int_t> list = cluster->
DigiList();
223 Int_t max_energy_idx = 0;
225 for(
size_t iDigi=0; iDigi<list.size(); ++iDigi) {
226 Int_t
idx = list[iDigi];
232 max_energy_idx =
idx;
237 cluster->SetTimeStamp(static_cast<PndEmcDigi*>(
fDigiArray->UncheckedAt(max_energy_idx))->GetTimeStamp());
245 std::cout <<
"Processed in total " <<
digiCounter <<
" digis within " <<
evtCounter <<
" events." << std::endl;
252 FairRun*
run = FairRun::Instance();
253 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
255 FairRuntimeDb* db = run->GetRuntimeDb();
256 if ( ! db ) Fatal(
"SetParContainers",
"No runtime database");
virtual void FinishClusters()
void SetEnergy(Double_t en)
bool isInCluster(PndEmcDigi *theDigi, const TClonesArray *digiArray)
virtual Double_t GetEnergy() const
represents the reconstructed hit of one emc crystal
Double_t val[nBoxes][nFEBox]
BinaryFunctor * fDigiFunctor
Double_t fDigiEnergyTresholdBarrel
Double_t GetEnergyThresholdBarrel()
void SetPersistency(Bool_t val=kTRUE)
const std::vector< Int_t > & DigiList() const
virtual void SetParContainers()
Short_t GetModule() const
void addCluster(PndEmcCluster *cluster, const TClonesArray *digiArray)
virtual void FinishTask()
Double_t fDigiEnergyTresholdShashlyk
virtual InitStatus Init()
Double_t GetClusterActiveTime()
Double_t GetEnergyThresholdFWD()
void FinishCluster(PndEmcCluster *tmpcluster)
virtual ~PndEmcMakeClusterOnline()
a cluster (group of neighboring crystals) of hit emc crystals
Double_t fDigiEnergyTresholdFWD
TClonesArray * fClusterArray
active clusters
TClonesArray * fDigiArray
Double_t fDigiEnergyTresholdBWD
virtual void Exec(Option_t *opt)
Double_t GetEnergyThresholdShashlyk()
Double_t fClusterActiveTime
Defines how long clusters are kept open in timebased reconstruction.
static PndEmcStructure * Instance()
Double_t GetEnergyThresholdBWD()
void SetStorageOfData(Bool_t val)
Method to specify whether clusters are stored or not.
Parameter set for Emc Reco.
virtual void addDigi(const TClonesArray *digiArray, Int_t iDigi)
PndEmcMakeClusterOnline(Int_t verbose=0, Bool_t storeclusters=kTRUE)