1 #include "ERSimtoRaw.h" 4 #include "TClonesArray.h" 13 : FairTask(
"Convert Sim event to Raw event", NEvents),
25 : FairTask(
"Convert Sim event to Raw event"),
45 FairRootManager* ioman = FairRootManager::Instance();
46 if ( ! ioman ) Fatal(
"Init",
"No FairRootManager");
50 fPixelSignals = (TClonesArray*) ioman->GetObject(
"NeuRadPixelSignal");
52 Fatal(
"Init",
"Can`t find branch in input file!");
55 fRawEvents =
new RawEvent*[fNChanels];
56 for (Int_t iChanel = 0; iChanel < fNChanels; iChanel++){
57 fRawEvents[iChanel] =
new RawEvent(fNPoints);
59 bName.Form(
"ch%d.",iChanel+1);
60 ioman->Register(bName,
"Raw", fRawEvents[iChanel], kTRUE);
71 if ( !(fEvent%100000) ) { std::cout <<
"####### EVENT " << fEvent <<
" #####" << std::endl; }
72 Int_t simSize,side,counter;
75 FairRun* run = FairRun::Instance();
76 run->MarkFill(kFALSE);
77 for (Int_t iSignal = 0; iSignal < fPixelSignals->GetEntriesFast(); iSignal++){
80 if ( signal->PixelNb() != 136 )
continue;
81 TArrayF* result = signal->ResultSignal();
84 simSize = result->GetSize();
86 if ( signal->Side() == 0 ){
87 for(Int_t i = 0; i<simSize; i++){
88 if( maxAmp < result->GetAt(i) ) {maxAmp = result->GetAt(i);}
92 cout <<
" not NULL event found " << endl;
102 for(Int_t nPoint = 0; nPoint< fNPoints; nPoint++){
104 if( nPoint<=(fNPoints - simSize)/2 || nPoint>=(fNPoints + simSize)/2 ) {
105 if(signal->Side() == 0) {fRawEvents[0]->SetAmp(0, nPoint);}
106 if(signal->Side() == 1) {fRawEvents[1]->SetAmp(0, nPoint);}
109 if(signal->Side() == 0) {fRawEvents[0]->SetAmp(-result->GetAt(nPoint - (fNPoints - simSize)/2), nPoint);}
110 if(signal->Side() == 1) {fRawEvents[1]->SetAmp(-result->GetAt(nPoint - (fNPoints - simSize)/2), nPoint);}
114 if(signal->Side() == 0) {fRawEvents[0]->SetTime(nPoint*0.1, nPoint);}
115 if(signal->Side() == 1) {fRawEvents[1]->SetTime(nPoint*0.1, nPoint);}
virtual void Exec(Option_t *opt)
virtual InitStatus Init()