12 #include "FairRootManager.h"
17 FairTask(
"Pnd SolCorr")
33 FairRootManager* ioman = FairRootManager::Instance();
37 std::cout <<
"-E- PndSolCorrTask::Init: "
38 <<
"RootManager not instantiated!" << std::endl;
43 std::cout <<
"kERROR ------ no inputBranch for PndSolCorrTask -------" << std::endl;
53 fInArrays.push_back((TClonesArray*)ioman->GetObject(inputName.Data()));
55 std::cout <<
" Input Array not found for PndSolCorrTask: "<< inputName << std::endl;
75 FairTimeStamp *outStamp;
84 for (
int j = 0; j <
fInArrays[
i]->GetEntriesFast(); j++){
87 fDataCorr_map.insert(std::pair<double,FairTimeStamp*>(outStamp->GetTimeStamp(),outStamp));
92 typedef std::multimap<double, FairTimeStamp*>::iterator DataIter;
94 new ((*fOutArray)[
fOutArray->GetEntries()]) FairTimeStamp(*(it->second));
105 time = inHit->GetTimeStamp();
115 for (
int j = 0; j < tempArray->GetEntriesFast(); j++){
116 inHit = (FairHit*) tempArray->At(j);
118 fDataCorr_map.insert(std::pair<double,FairTimeStamp*>(outStamp->GetTimeStamp(),outStamp));
125 typedef std::multimap<double, FairTimeStamp*>::iterator DataIter;
127 new ((*fOutArray)[
fOutArray->GetEntries()]) FairTimeStamp(*(it->second));
140 if (IsActive()==kFALSE)
return;
144 typedef std::multimap<double, FairTimeStamp*>::iterator DataIter;
146 new ((*fOutArray)[
fOutArray->GetEntries()]) FairTimeStamp(*(it->second));
149 FairRootManager::Instance()->SetLastFill();
156 double time, time_corr, trackLength;
158 FairMultiLinkedData* links = NULL;
159 FairTimeStamp* outStamp;
161 inHit->Position(hitPos);
162 trackLength = hitPos.Mag();
163 time = inHit->GetTimeStamp();
164 time_corr = time - (trackLength/100/
TMath::C()*1000000000 );
165 outStamp =
new FairTimeStamp(time_corr);
166 outStamp->SetLink(inHit->GetEntryNr());
167 links = inHit->GetPointerToLinks();
168 if(links != NULL) outStamp->AddLinks(*links);
BinaryFunctor * fStopFunctor
virtual void Exec(Option_t *opt)
std::vector< TString > fInBranches
cout<< "POINTs for new FwEndCap == "<< tsim-> GetEntriesFast()
virtual InitStatus Init()
virtual ~PndSolCorrTask()
std::multimap< double, FairTimeStamp * > fDataCorr_map
virtual void FinishTask()
std::vector< TClonesArray * > fInArrays
FairTimeStamp * SolCorr(FairHit *inHit)
cout<<"the Event No is "<< i<< endl;{{if(hit_array->GetEntriesFast()!=mc_array->GetEntriesFast()) continue;PndSdsHit *hit=(PndSdsHit *) hit_array-> At(j)