40 void SmearTask::CheckCutContainerCollections() {
41 if (fCutContainer->GetEventCollectionsNo() > 1) {
42 Cout::PrintInfo(
"Too many event collections, they will be removed! ", EInfo::kLowWarning);
43 for (
int i = 1; i < fCutContainer->GetEventCollectionsNo(); i++)
44 fCutContainer->RemoveCollection(ECutUpdate::kEvent, i);
46 TrackAna::CheckCutContainerCollections();
58 Task::EInitFlag SmearTask::Init() {
62 if (temp->InheritsFrom(
"Hal::EventSmeared")) {
63 Cout::PrintInfo(
"Cannot set smeared algorithm in smearing task", EInfo::kCriticalError);
64 return Task::EInitFlag::kFATAL;
67 Task::EInitFlag stat = TrackAna::Init();
68 if (stat == Task::EInitFlag::kFATAL)
return stat;
69 Event*
event = fMemoryMap->GetTemporaryEvent();
71 fCurrentEventSmeared->ActivateSmearing();
74 Event* img = fCurrentEventSmeared->GetImgEvent();
75 ioManager->
Register(Form(
"%s.", img->ClassName()),
"HalEvents", img, kFALSE);
77 if (fEventAlgorithm == NULL) {
78 Cout::PrintInfo(
"No event smear algorithm, new will be added but do virtual", EInfo::kLowWarning);
81 if (fTrackAlgorithm == NULL) {
82 Cout::PrintInfo(
"No track smear algorithm, new will be added but do virtual", EInfo::kLowWarning);
85 if (fEventAlgorithm->Init() == Task::EInitFlag::kFATAL) {
86 Cout::PrintInfo(
"Failed to initialize EventSmear", EInfo::kError);
87 return Task::EInitFlag::kFATAL;
89 if (fTrackAlgorithm->Init() == Task::EInitFlag::kFATAL) {
90 Cout::PrintInfo(
"Failed to initialize TrackSmear", EInfo::kError);
91 return Task::EInitFlag::kFATAL;
98 void SmearTask::ProcessEvent() {
99 fEventAlgorithm->ModifyEvent((
SmearedEvent*) fCurrentEventSmeared);
100 CutCollection* cont = fCutContainer->GetEventCollection(fCurrentEventCollectionID);
101 for (
int i = 0; i < fMemoryMap->GetTemporaryTotalTracksNo(); i++) {
102 for (
int j = 0; j < cont->
GetNextNo(); j++) {
104 fCurrentTrack = fCurrentEventSmeared->
GetTrack(i);
105 if (fCutContainer->PassTrack(fCurrentTrack, fCurrentTrackCollectionID)) {
106 fTrackAlgorithm->ModifyTrack((
SmearedTrack*) fCurrentTrack);
112 void SmearTask::Exec(Option_t* ) {
114 fCurrentEvent = fMemoryMap->GetTemporaryEvent();
115 fMemoryMap->ManualUpdate(fCurrentEventSmeared);
116 for (fCurrentEventCollectionID = 0; fCurrentEventCollectionID < fEventCollectionsNo; fCurrentEventCollectionID++) {
117 if (fCutContainer->PassEvent(fCurrentEvent, fCurrentEventCollectionID)) { ProcessEvent(); }