fCutsEvent(NULL),
fCutsRP(NULL),
fCutsPOI(NULL),
- fQAInt(NULL),
- fQADiff(NULL),
+ fQAList(NULL),
fMinMult(0),
fMaxMult(10000000),
fMinA(-1.0),
fMaxA(-0.01),
fMinB(0.01),
fMaxB(1.0),
- fQA(kFALSE),
+ fQAon(kFALSE),
fLoadCandidates(kFALSE),
fNbinsMult(10000),
fNbinsPt(100),
fEtaMax(5.),
fQMin(0.),
fQMax(3.),
+ fHistWeightvsPhiMin(0.),
+ fHistWeightvsPhiMax(3.),
fExcludedEtaMin(0.),
fExcludedEtaMax(0.),
fExcludedPhiMin(0.),
fV2(0.),
fV3(0.),
fV4(0.),
+ fV5(0.),
+ fFlowEvent(NULL),
fMyTRandom3(NULL)
{
// Constructor
fCutsEvent(NULL),
fCutsRP(NULL),
fCutsPOI(NULL),
- fQAInt(NULL),
- fQADiff(NULL),
+ fQAList(NULL),
fMinMult(0),
fMaxMult(10000000),
fMinA(-1.0),
fMaxA(-0.01),
fMinB(0.01),
fMaxB(1.0),
- fQA(on),
+ fQAon(on),
fLoadCandidates(bCandidates),
fNbinsMult(10000),
fNbinsPt(100),
fEtaMax(5.),
fQMin(0.),
fQMax(3.),
+ fHistWeightvsPhiMin(0.),
+ fHistWeightvsPhiMax(3.),
fExcludedEtaMin(0.),
fExcludedEtaMax(0.),
fExcludedPhiMin(0.),
fV2(0.),
fV3(0.),
fV4(0.),
+ fV5(0.),
+ fFlowEvent(NULL),
fMyTRandom3(NULL)
{
// Constructor
// Define output slots here
// Define here the flow event output
DefineOutput(1, AliFlowEventSimple::Class());
- if(on)
- {
- DefineOutput(2, TList::Class());
- DefineOutput(3, TList::Class());
- }
+ DefineOutput(2, TList::Class());
// and for testing open an output file
// fOutputFile = new TFile("FlowEvents.root","RECREATE");
// Destructor
//
delete fMyTRandom3;
+ delete fFlowEvent;
+ delete fCutsEvent;
+ delete fCutsRP;
+ delete fCutsPOI;
+ delete fQAList;
// objects in the output list are deleted
// by the TSelector dtor (I hope)
cc->SetEtaMax(fEtaMax);
cc->SetQMin(fQMin);
cc->SetQMax(fQMax);
+ cc->SetHistWeightvsPhiMax(fHistWeightvsPhiMax);
+ cc->SetHistWeightvsPhiMin(fHistWeightvsPhiMin);
+ fFlowEvent = new AliFlowEvent(3000);
+
+ if (fQAon)
+ {
+ fQAList=new TList();
+ fQAList->SetOwner();
+ fQAList->SetName(Form("%s QA",GetName()));
+ if (fCutsEvent->GetQA()) fQAList->Add(fCutsEvent->GetQA()); //0
+ if (fCutsRP->GetQA()) fQAList->Add(fCutsRP->GetQA()); //1
+ if (fCutsPOI->GetQA())fQAList->Add(fCutsPOI->GetQA()); //2
+ fQAList->Add(new TH1F("event plane angle","event plane angle;angle [rad];",100,0.,TMath::TwoPi())); //3
+ PostData(2,fQAList);
+ }
}
//________________________________________________________________________
{
// Main loop
// Called for each event
- AliFlowEvent* flowEvent = NULL;
+ //delete fFlowEvent;
AliMCEvent* mcEvent = MCEvent(); // from TaskSE
AliESDEvent* myESD = dynamic_cast<AliESDEvent*>(InputEvent()); // from TaskSE
AliAODEvent* myAOD = dynamic_cast<AliAODEvent*>(InputEvent()); // from TaskSE
AliMultiplicity* myTracklets = NULL;
AliESDPmdTrack* pmdtracks = NULL;//pmd
- TH2F* histFMD = NULL;
int availableINslot=1;
- if(strcmp(fRPType,"FMD")==0) {
- TList* FMDdata = dynamic_cast<TList*>(GetInputData(availableINslot++));
- if(!FMDdata) {
- cout<<" No FMDdata "<<endl;
- exit(2);
- }
- histFMD = dynamic_cast<TH2F*>(FMDdata->FindObject("dNdetadphiHistogramTrVtx"));
- if (!histFMD) {
- cout<< "No histFMD"<<endl;
- exit(2);
- }
- }
if (!(fCutsRP&&fCutsPOI&&fCutsEvent))
{
return;
}
- //use the new and temporarily incomplete way of doing things
+ //DEFAULT - automatically takes care of everything
if (fAnalysisType == "AUTOMATIC")
{
//check event cuts
- if (!fCutsEvent->IsSelected(InputEvent())) return;
+ if (InputEvent() && !fCutsEvent->IsSelected(InputEvent())) return;
//first attach all possible information to the cuts
fCutsRP->SetEvent( InputEvent(), MCEvent() ); //attach event
fCutsPOI->SetEvent( InputEvent(), MCEvent() );
//then make the event
- flowEvent = new AliFlowEvent( fCutsRP, fCutsPOI );
+ fFlowEvent->Fill( fCutsRP, fCutsPOI );
+ //fFlowEvent = new AliFlowEvent( fCutsRP, fCutsPOI );
+
if (myESD)
- flowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity(InputEvent()));
- if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent);
+ fFlowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity(InputEvent()));
+ if (mcEvent && mcEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(mcEvent);
}
// Make the FlowEvent for MC input
- if (fAnalysisType == "MC")
+ else if (fAnalysisType == "MC")
{
// Process MC truth, therefore we receive the AliAnalysisManager and ask it for the AliMCEventHandler
// This handler can return the current MC event
AliWarning("Event does not pass multiplicity cuts"); return;
}
//make event
- flowEvent = new AliFlowEvent(mcEvent,fCFManager1,fCFManager2);
+ fFlowEvent = new AliFlowEvent(mcEvent,fCFManager1,fCFManager2);
}
// Make the FlowEvent for ESD input
//make event
if (fRPType == "Global") {
- flowEvent = new AliFlowEvent(myESD,fCFManager1,fCFManager2);
+ fFlowEvent = new AliFlowEvent(myESD,fCFManager1,fCFManager2);
}
- if (fRPType == "TPCOnly") {
- flowEvent = new AliFlowEvent(myESD,fCFManager2,kFALSE);
+ else if (fRPType == "TPCOnly") {
+ fFlowEvent = new AliFlowEvent(myESD,fCFManager2,kFALSE);
}
- if (fRPType == "TPCHybrid") {
- flowEvent = new AliFlowEvent(myESD,fCFManager2,kTRUE);
+ else if (fRPType == "TPCHybrid") {
+ fFlowEvent = new AliFlowEvent(myESD,fCFManager2,kTRUE);
}
else if (fRPType == "Tracklet"){
- flowEvent = new AliFlowEvent(myESD,myTracklets,fCFManager2);
+ fFlowEvent = new AliFlowEvent(myESD,myTracklets,fCFManager2);
}
else if (fRPType == "FMD"){
- flowEvent = new AliFlowEvent(myESD,histFMD,fCFManager2);
+ TList* FMDdata = dynamic_cast<TList*>(GetInputData(availableINslot++));
+ if(!FMDdata) {
+ cout<<" No FMDdata "<<endl;
+ return;
+ }
+ TH2F* histFMD = dynamic_cast<TH2F*>(FMDdata->FindObject("dNdetadphiHistogramTrVtx"));
+ if (!histFMD) {
+ cout<< "No histFMD"<<endl;
+ return;
+ }
+ fFlowEvent = new AliFlowEvent(myESD,histFMD,fCFManager2);
}
else if (fRPType == "PMD"){
- flowEvent = new AliFlowEvent(myESD,pmdtracks,fCFManager2);
+ fFlowEvent = new AliFlowEvent(myESD,pmdtracks,fCFManager2);
}
else return;
// if monte carlo event get reaction plane from monte carlo (depends on generator)
- if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent);
+ if (mcEvent && mcEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(mcEvent);
//set reference multiplicity, TODO: maybe move it to the constructor?
- flowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE));
+ fFlowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE));
}
// Make the FlowEvent for ESD input combined with MC info
//make event
if (fAnalysisType == "ESDMCkineESD")
{
- flowEvent = new AliFlowEvent(myESD, mcEvent, AliFlowEvent::kESDkine, fCFManager1, fCFManager2 );
+ fFlowEvent = new AliFlowEvent(myESD, mcEvent, AliFlowEvent::kESDkine, fCFManager1, fCFManager2 );
}
else if (fAnalysisType == "ESDMCkineMC")
{
- flowEvent = new AliFlowEvent(myESD, mcEvent, AliFlowEvent::kMCkine, fCFManager1, fCFManager2 );
+ fFlowEvent = new AliFlowEvent(myESD, mcEvent, AliFlowEvent::kMCkine, fCFManager1, fCFManager2 );
}
+ if (!fFlowEvent) return;
// if monte carlo event get reaction plane from monte carlo (depends on generator)
- if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent);
+ if (mcEvent && mcEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(mcEvent);
//set reference multiplicity, TODO: maybe move it to the constructor?
- flowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE));
+ fFlowEvent->SetReferenceMultiplicity(AliESDtrackCuts::GetReferenceMultiplicity(myESD,kTRUE));
}
// Make the FlowEventSimple for AOD input
else if (fAnalysisType == "AOD")
return;
}
AliInfo(Form("AOD has %d tracks", myAOD->GetNumberOfTracks()));
- flowEvent = new AliFlowEvent(myAOD);
+ fFlowEvent = new AliFlowEvent(myAOD);
}
//inject candidates
//printf(" Ⱶ Checking at candidate %d with %d daughters\n",iCand,cand->GetNDaughters());
for(int iDau=0; iDau!=cand->GetNDaughters(); ++iDau) {
//printf(" Ⱶ Daughter %d with fID %d", iDau, cand->GetIDDaughter(iDau) );
- for(int iRPs=0; iRPs!=flowEvent->NumberOfTracks(); ++iRPs ) {
- AliFlowTrack *iRP = dynamic_cast<AliFlowTrack*>(flowEvent->GetTrack( iRPs ));
+ for(int iRPs=0; iRPs!=fFlowEvent->NumberOfTracks(); ++iRPs ) {
+ AliFlowTrack *iRP = dynamic_cast<AliFlowTrack*>(fFlowEvent->GetTrack( iRPs ));
if (!iRP) continue;
if( !iRP->InRPSelection() )
continue;
}
//printf("\n");
}
- flowEvent->AddTrack(cand);
+ fFlowEvent->AddTrack(cand);
}
}
}
+ if (!fFlowEvent) return; //shuts up coverity
+
//check final event cuts
- Int_t mult = flowEvent->NumberOfTracks();
+ Int_t mult = fFlowEvent->NumberOfTracks();
AliInfo(Form("FlowEvent has %i tracks",mult));
if (mult<fMinMult || mult>fMaxMult)
{
}
//define dead zone
- flowEvent->DefineDeadZone(fExcludedEtaMin, fExcludedEtaMax, fExcludedPhiMin, fExcludedPhiMax );
+ fFlowEvent->DefineDeadZone(fExcludedEtaMin, fExcludedEtaMax, fExcludedPhiMin, fExcludedPhiMax );
//////////////////////////////////////////////////////////////////////////////
if (fAfterburnerOn)
{
//if reaction plane not set from elsewhere randomize it before adding flow
- if (!flowEvent->IsSetMCReactionPlaneAngle())
- flowEvent->SetMCReactionPlaneAngle(gRandom->Uniform(0.0,TMath::TwoPi()));
+ if (!fFlowEvent->IsSetMCReactionPlaneAngle())
+ fFlowEvent->SetMCReactionPlaneAngle(gRandom->Uniform(0.0,TMath::TwoPi()));
- flowEvent->AddFlow(fV1,fV2,fV3,fV4); //add flow
- flowEvent->CloneTracks(fNonFlowNumberOfTrackClones); //add nonflow by cloning tracks
+ fFlowEvent->AddFlow(fV1,fV2,fV3,fV4,fV5); //add flow
+ fFlowEvent->CloneTracks(fNonFlowNumberOfTrackClones); //add nonflow by cloning tracks
}
//////////////////////////////////////////////////////////////////////////////
//tag subEvents
- flowEvent->TagSubeventsInEta(fMinA,fMaxA,fMinB,fMaxB);
+ fFlowEvent->TagSubeventsInEta(fMinA,fMaxA,fMinB,fMaxB);
- //fListHistos->Print();
- //fOutputFile->WriteObject(flowEvent,"myFlowEventSimple");
- PostData(1,flowEvent);
- if (fQA)
+ //QA
+ if (fQAon)
{
- PostData(2,fQAInt);
- PostData(3,fQADiff);
+ TH1* h1 = static_cast<TH1*>(fQAList->At(3));
+ h1->Fill(fFlowEvent->GetMCReactionPlaneAngle());
}
+
+ //fListHistos->Print();
+ //fOutputFile->WriteObject(fFlowEvent,"myFlowEventSimple");
+ PostData(1,fFlowEvent);
}
//________________________________________________________________________