11 #include <FairLogger.h>
12 #include <FairParSet.h>
13 #include <FairRootManager.h>
14 #include <FairRunAna.h>
15 #include <FairRuntimeDb.h>
18 #include <Math/Point2D.h>
19 #include <Math/Point2Dfwd.h>
20 #include <Math/Vector3D.h>
21 #include <Math/Vector3Dfwd.h>
22 #include <TClonesArray.h>
30 constexpr
auto cRED =
"\033[1;31m";
33 constexpr
auto cGREEN =
"\033[1;32m";
39 : FairTask(
"AtPulseTask"), fPulse(std::move(pulse)), fRawEventArray(TClonesArray(
"AtRawEvent", 1))
45 FairRunAna *ana = FairRunAna::Instance();
46 FairRuntimeDb *rtdb = ana->GetRuntimeDb();
47 fPar =
dynamic_cast<AtDigiPar *
>(rtdb->getContainer(
"AtDigiPar"));
49 LOG(fatal) <<
"Could not get the parameter container "
55 LOG(INFO) <<
"Initilization of AtPulseTask";
56 FairRootManager *ioman = FairRootManager::Instance();
60 LOG(fatal) <<
"ERROR: Cannot find fSimulatedPointArray array!";
69 fMCPointArray =
dynamic_cast<TClonesArray *
>(ioman->GetObject(
"AtTpcPoint"));
71 LOG(fatal) <<
"Cannot find fMCPointArray array!";
79 LOG(info) <<
" AtPulseTask : Initialization of parameters complete!";
85 LOG(debug) <<
"Exec of AtPulseTask";
89 LOG(info) <<
"AtPulseTask: Number of Points " << nMCPoints;
93 std::vector<AtSimulatedPoint *> simPoints;
94 for (Int_t i = 0; i < nMCPoints; i++) {
99 auto rawEvent =
fPulse->GenerateEvent(simPoints);
101 LOG(info) <<
"...End of collection of electrons in this event." << std::endl;
106 rawEvent.SetIsGood(
true);
110 std::cout <<
"AtPulseTask Event ID : " <<
fEventID <<
"\n";
117 int padNum =
fPulse->GetMap()->GetPadNum(pos);
130 auto trackIDMap = mcPointMap->GetTrackID();
131 if (it->second == mcPointID || (trackID == trackIDMap)) {
139 MCPointsMap.insert(std::make_pair(padNumber, mcPointID));