2 // Analysis task for 'mini' sub-package
3 // Contains all definitions needed for running an analysis:
5 // -- a list of track cuts (any number)
6 // -- definitions of output histograms
7 // -- values to be computed.
8 // Each one must be defined using the "CREATE" methods, which
9 // add directly a new element in the task collections, and don't
10 // need an external object to be passed to the task itself.
13 #include <Riostream.h>
18 #include <TStopwatch.h>
22 #include "AliEventplane.h"
23 #include "AliMultiplicity.h"
24 #include "AliTriggerAnalysis.h"
25 #include "AliAnalysisManager.h"
26 #include "AliInputEventHandler.h"
28 #include "AliESDtrackCuts.h"
29 #include "AliESDUtils.h"
31 #include "AliAODEvent.h"
32 #include "AliAODMCParticle.h"
34 #include "AliRsnCutSet.h"
35 #include "AliRsnMiniPair.h"
36 #include "AliRsnMiniEvent.h"
37 #include "AliRsnMiniParticle.h"
39 #include "AliRsnMiniAnalysisTask.h"
42 ClassImp(AliRsnMiniAnalysisTask)
44 //__________________________________________________________________________________________________
45 AliRsnMiniAnalysisTask::AliRsnMiniAnalysisTask() :
50 fUseCentrality(kFALSE),
51 fCentralityType("QUALITY"),
52 fUseAOD049CentralityPatch(kFALSE),
53 fUseCentralityPatchPbPb2011(0),
54 fContinuousMix(kTRUE),
60 fHistograms("AliRsnMiniOutput", 0),
61 fValues("AliRsnMiniValue", 0),
63 fHAEventsVsMulti(0x0),
65 fHAEventMultiCent(0x0),
78 fCheckFeedDown(kFALSE),
79 fOriginDselection(kFALSE),
81 fKeepDfromBOnly(kFALSE),
82 fRejectIfNoQuark(kFALSE)
85 // Dummy constructor ALWAYS needed for I/O.
89 //__________________________________________________________________________________________________
90 AliRsnMiniAnalysisTask::AliRsnMiniAnalysisTask(const char *name, Bool_t useMC) :
91 AliAnalysisTaskSE(name),
94 fTriggerMask(AliVEvent::kMB),
95 fUseCentrality(kFALSE),
96 fCentralityType("QUALITY"),
97 fUseAOD049CentralityPatch(kFALSE),
98 fUseCentralityPatchPbPb2011(0),
99 fContinuousMix(kTRUE),
105 fHistograms("AliRsnMiniOutput", 0),
106 fValues("AliRsnMiniValue", 0),
108 fHAEventsVsMulti(0x0),
110 fHAEventMultiCent(0x0),
120 fMixPrintRefresh(-1),
123 fCheckFeedDown(kFALSE),
124 fOriginDselection(kFALSE),
126 fKeepDfromBOnly(kFALSE),
127 fRejectIfNoQuark(kFALSE)
130 // Default constructor.
131 // Define input and output slots here (never in the dummy constructor)
132 // Input slot #0 works with a TChain - it is connected to the default input container
133 // Output slot #1 writes into a TH1 container
136 DefineOutput(1, TList::Class());
139 //__________________________________________________________________________________________________
140 AliRsnMiniAnalysisTask::AliRsnMiniAnalysisTask(const AliRsnMiniAnalysisTask ©) :
141 AliAnalysisTaskSE(copy),
144 fTriggerMask(copy.fTriggerMask),
145 fUseCentrality(copy.fUseCentrality),
146 fCentralityType(copy.fCentralityType),
147 fUseAOD049CentralityPatch(copy.fUseAOD049CentralityPatch),
148 fUseCentralityPatchPbPb2011(copy.fUseCentralityPatchPbPb2011),
149 fContinuousMix(copy.fContinuousMix),
151 fMaxDiffMult(copy.fMaxDiffMult),
152 fMaxDiffVz(copy.fMaxDiffVz),
153 fMaxDiffAngle(copy.fMaxDiffAngle),
155 fHistograms(copy.fHistograms),
156 fValues(copy.fValues),
158 fHAEventsVsMulti(0x0),
160 fHAEventMultiCent(0x0),
162 fEventCuts(copy.fEventCuts),
163 fTrackCuts(copy.fTrackCuts),
166 fTriggerAna(copy.fTriggerAna),
167 fESDtrackCuts(copy.fESDtrackCuts),
169 fBigOutput(copy.fBigOutput),
170 fMixPrintRefresh(copy.fMixPrintRefresh),
171 fMaxNDaughters(copy.fMaxNDaughters),
172 fCheckP(copy.fCheckP),
173 fCheckFeedDown(copy.fCheckFeedDown),
174 fOriginDselection(copy.fOriginDselection),
175 fKeepDfromB(copy.fOriginDselection),
176 fKeepDfromBOnly(copy.fKeepDfromBOnly),
177 fRejectIfNoQuark(copy.fRejectIfNoQuark)
181 // Implemented as requested by C++ standards.
182 // Can be used in PROOF and by plugins.
186 //__________________________________________________________________________________________________
187 AliRsnMiniAnalysisTask &AliRsnMiniAnalysisTask::operator=(const AliRsnMiniAnalysisTask ©)
190 // Assignment operator.
191 // Implemented as requested by C++ standards.
192 // Can be used in PROOF and by plugins.
195 AliAnalysisTaskSE::operator=(copy);
198 fUseMC = copy.fUseMC;
199 fEvNum = copy.fEvNum;
200 fTriggerMask = copy.fTriggerMask;
201 fUseCentrality = copy.fUseCentrality;
202 fCentralityType = copy.fCentralityType;
203 fUseAOD049CentralityPatch = copy.fUseAOD049CentralityPatch;
204 fUseCentralityPatchPbPb2011 = copy.fUseCentralityPatchPbPb2011;
205 fContinuousMix = copy.fContinuousMix;
207 fMaxDiffMult = copy.fMaxDiffMult;
208 fMaxDiffVz = copy.fMaxDiffVz;
209 fMaxDiffAngle = copy.fMaxDiffAngle;
210 fHistograms = copy.fHistograms;
211 fValues = copy.fValues;
212 fHEventStat = copy.fHEventStat;
213 fHAEventsVsMulti = copy.fHAEventsVsMulti;
214 fHAEventVz = copy.fHAEventVz;
215 fHAEventMultiCent = copy.fHAEventMultiCent;
216 fHAEventPlane = copy.fHAEventPlane;
217 fEventCuts = copy.fEventCuts;
218 fTrackCuts = copy.fTrackCuts;
219 fTriggerAna = copy.fTriggerAna;
220 fESDtrackCuts = copy.fESDtrackCuts;
221 fBigOutput = copy.fBigOutput;
222 fMixPrintRefresh = copy.fMixPrintRefresh;
223 fMaxNDaughters = copy.fMaxNDaughters;
224 fCheckP = copy.fCheckP;
225 fCheckFeedDown = copy.fCheckFeedDown;
226 fOriginDselection = copy.fOriginDselection;
227 fKeepDfromB = copy.fOriginDselection;
228 fKeepDfromBOnly = copy.fKeepDfromBOnly;
229 fRejectIfNoQuark = copy.fRejectIfNoQuark;
233 //__________________________________________________________________________________________________
234 AliRsnMiniAnalysisTask::~AliRsnMiniAnalysisTask()
238 // Clean-up the output list, but not the histograms that are put inside
239 // (the list is owner and will clean-up these histograms). Protect in PROOF case.
243 if (fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
249 //__________________________________________________________________________________________________
250 Int_t AliRsnMiniAnalysisTask::AddTrackCuts(AliRsnCutSet *cuts)
253 // Add a new cut set for a new criterion for track selection.
254 // A user can add as many as he wants, and each one corresponds
255 // to one of the available bits in the AliRsnMiniParticle mask.
256 // The only check is the following: if a cut set with the same name
257 // as the argument is there, this is not added.
258 // Return value is the array position of this set.
261 TObject *obj = fTrackCuts.FindObject(cuts->GetName());
264 AliInfo(Form("A cut set named '%s' already exists", cuts->GetName()));
265 return fTrackCuts.IndexOf(obj);
267 fTrackCuts.AddLast(cuts);
268 return fTrackCuts.IndexOf(cuts);
272 //__________________________________________________________________________________________________
273 void AliRsnMiniAnalysisTask::UserCreateOutputObjects()
276 // Initialization of outputs.
277 // This is called once per worker node.
284 AliInfo(Form("Selected event characterization: %s (%s)", (fUseCentrality ? "centrality" : "multiplicity"), fCentralityType.Data()));
286 // initialize trigger analysis
287 if (fTriggerAna) delete fTriggerAna;
288 fTriggerAna = new AliTriggerAnalysis;
290 // initialize ESD quality cuts
291 if (fESDtrackCuts) delete fESDtrackCuts;
292 fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
294 // create list and set it as owner of its content (MANDATORY)
295 if (fBigOutput) OpenFile(1);
296 fOutput = new TList();
299 // initialize event statistics counter
300 fHEventStat = new TH1F("hEventStat", "Event statistics", 4, 0.0, 4.0);
301 fHEventStat->GetXaxis()->SetBinLabel(1, "CINT1B");
302 fHEventStat->GetXaxis()->SetBinLabel(2, "V0AND");
303 fHEventStat->GetXaxis()->SetBinLabel(3, "Candle");
304 fHEventStat->GetXaxis()->SetBinLabel(4, "Accepted");
305 fOutput->Add(fHEventStat);
308 fHAEventsVsMulti = new TH1F("hAEventsVsMulti", "Accepted events vs Centrality", 100, 0, 100.0);
310 fHAEventsVsMulti = new TH1F("hAEventsVsMulti", "Accepted events vs Multiplicity",1000, 0, 1000.0);
311 fOutput->Add(fHAEventsVsMulti);
313 if(fHAEventVz) fOutput->Add(fHAEventVz);
314 if(fHAEventMultiCent) fOutput->Add(fHAEventMultiCent);
315 if(fHAEventPlane) fOutput->Add(fHAEventPlane);
317 TIter next(&fTrackCuts);
319 while ((cs = (AliRsnCutSet *) next())) {
323 // create temporary tree for filtered events
324 if (fMiniEvent) delete fMiniEvent;
325 fEvBuffer = new TTree("EventBuffer", "Temporary buffer for mini events");
326 fEvBuffer->Branch("events", "AliRsnMiniEvent", &fMiniEvent);
328 // create one histogram per each stored definition (event histograms)
329 Int_t i, ndef = fHistograms.GetEntries();
330 AliRsnMiniOutput *def = 0x0;
331 for (i = 0; i < ndef; i++) {
332 def = (AliRsnMiniOutput *)fHistograms[i];
334 if (!def->Init(GetName(), fOutput)) {
335 AliError(Form("Def '%s': failed initialization", def->GetName()));
340 // post data for ALL output slots >0 here, to get at least an empty histogram
341 PostData(1, fOutput);
344 //__________________________________________________________________________________________________
345 void AliRsnMiniAnalysisTask::UserExec(Option_t *)
349 // In this case, it checks if the event is acceptable, and eventually
350 // creates the corresponding mini-event and stores it in the buffer.
351 // The real histogram filling is done at the end, in "FinishTaskOutput".
354 // increment event counter
357 // check current event
358 Char_t check = CheckCurrentEvent();
361 // setup PID response
362 AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
363 AliInputEventHandler *inputHandler = (AliInputEventHandler *)man->GetInputEventHandler();
364 fRsnEvent.SetPIDResponse(inputHandler->GetPIDResponse());
366 // fill a mini-event from current
367 // and skip this event if no tracks were accepted
368 FillMiniEvent(check);
370 // fill MC based histograms on mothers,
371 // which do need the original event
373 if (fRsnEvent.IsESD() && fMCEvent)
374 FillTrueMotherESD(fMiniEvent);
375 else if (fRsnEvent.IsAOD() && fRsnEvent.GetAODList())
376 FillTrueMotherAOD(fMiniEvent);
379 // if the event is not empty, store it
380 if (fMiniEvent->IsEmpty()) {
381 AliDebugClass(2, Form("Rejecting empty event #%d", fEvNum));
383 Int_t id = fEvBuffer->GetEntries();
384 AliDebugClass(2, Form("Adding event #%d with ID = %d", fEvNum, id));
385 fMiniEvent->ID() = id;
389 // post data for computed stuff
390 PostData(1, fOutput);
393 //__________________________________________________________________________________________________
394 void AliRsnMiniAnalysisTask::FinishTaskOutput()
397 // This function is called at the end of the loop on available events,
398 // and then the buffer will be full with all the corresponding mini-events,
399 // each one containing all tracks selected by each of the available track cuts.
400 // Here a loop is done on each of these events, and both single-event and mixing are computed
403 // security code: reassign the buffer to the mini-event cursor
404 fEvBuffer->SetBranchAddress("events", &fMiniEvent);
407 Int_t ievt, nEvents = (Int_t)fEvBuffer->GetEntries();
408 Int_t idef, nDefs = fHistograms.GetEntries();
409 Int_t imix, iloop, ifill;
410 AliRsnMiniOutput *def = 0x0;
411 AliRsnMiniOutput::EComputation compType;
413 Int_t printNum = fMixPrintRefresh;
415 if (nEvents>1e5) printNum=nEvents/100;
416 else if (nEvents>1e4) printNum=nEvents/10;
420 // loop on events, and for each one fill all outputs
421 // using the appropriate procedure depending on its type
422 // only mother-related histograms are filled in UserExec,
423 // since they require direct access to MC event
425 for (ievt = 0; ievt < nEvents; ievt++) {
427 fEvBuffer->GetEntry(ievt);
428 if (printNum&&(ievt%printNum==0)) {
429 AliInfo(Form("[%s] Std.Event %d/%d",GetName(), ievt,nEvents));
430 timer.Stop(); timer.Print(); fflush(stdout); timer.Start(kFALSE);
433 for (idef = 0; idef < nDefs; idef++) {
434 def = (AliRsnMiniOutput *)fHistograms[idef];
436 compType = def->GetComputation();
437 // execute computation in the appropriate way
439 case AliRsnMiniOutput::kEventOnly:
440 //AliDebugClass(1, Form("Event %d, def '%s': event-value histogram filling", ievt, def->GetName()));
442 def->FillEvent(fMiniEvent, &fValues);
444 case AliRsnMiniOutput::kTruePair:
445 //AliDebugClass(1, Form("Event %d, def '%s': true-pair histogram filling", ievt, def->GetName()));
446 ifill = def->FillPair(fMiniEvent, fMiniEvent, &fValues);
448 case AliRsnMiniOutput::kTrackPair:
449 //AliDebugClass(1, Form("Event %d, def '%s': pair-value histogram filling", ievt, def->GetName()));
450 ifill = def->FillPair(fMiniEvent, fMiniEvent, &fValues);
452 case AliRsnMiniOutput::kTrackPairRotated1:
453 //AliDebugClass(1, Form("Event %d, def '%s': rotated (1) background histogram filling", ievt, def->GetName()));
454 ifill = def->FillPair(fMiniEvent, fMiniEvent, &fValues);
456 case AliRsnMiniOutput::kTrackPairRotated2:
457 //AliDebugClass(1, Form("Event %d, def '%s': rotated (2) background histogram filling", ievt, def->GetName()));
458 ifill = def->FillPair(fMiniEvent, fMiniEvent, &fValues);
461 // other kinds are processed elsewhere
463 AliDebugClass(2, Form("Computation = %d", (Int_t)compType));
466 AliDebugClass(1, Form("Event %6d: def = '%15s' -- fills = %5d", ievt, def->GetName(), ifill));
470 // if no mixing is required, stop here and post the output
472 AliDebugClass(2, "Stopping here, since no mixing is required");
473 PostData(1, fOutput);
477 // initialize mixing counter
478 Int_t nmatched[nEvents];
479 TString *smatched = new TString[nEvents];
480 for (ievt = 0; ievt < nEvents; ievt++) {
481 smatched[ievt] = "|";
486 AliInfo(Form("[%s] Std.Event %d/%d",GetName(), nEvents,nEvents));
487 timer.Stop(); timer.Print(); timer.Start(); fflush(stdout);
489 // search for good matchings
490 for (ievt = 0; ievt < nEvents; ievt++) {
491 if (printNum&&(ievt%printNum==0)) {
492 AliInfo(Form("[%s] EventMixing searching %d/%d",GetName(),ievt,nEvents));
493 timer.Stop(); timer.Print(); timer.Start(kFALSE); fflush(stdout);
495 if (nmatched[ievt] >= fNMix) continue;
496 fEvBuffer->GetEntry(ievt);
497 AliRsnMiniEvent evMain(*fMiniEvent);
498 for (iloop = 1; iloop < nEvents; iloop++) {
500 if (imix >= nEvents) imix -= nEvents;
501 if (imix == ievt) continue;
503 fEvBuffer->GetEntry(imix);
504 // skip if events are not matched
505 if (!EventsMatch(&evMain, fMiniEvent)) continue;
506 // check that the array of good matches for mixed does not already contain main event
507 if (smatched[imix].Contains(Form("|%d|", ievt))) continue;
508 // check that the found good events has not enough matches already
509 if (nmatched[imix] >= fNMix) continue;
510 // add new mixing candidate
511 smatched[ievt].Append(Form("%d|", imix));
514 if (nmatched[ievt] >= fNMix) break;
516 AliDebugClass(1, Form("Matches for event %5d = %d [%s] (missing are declared above)", evMain.ID(), nmatched[ievt], smatched[ievt].Data()));
519 AliInfo(Form("[%s] EventMixing searching %d/%d",GetName(),nEvents,nEvents));
520 timer.Stop(); timer.Print(); fflush(stdout); timer.Start();
523 TObjArray *list = 0x0;
524 TObjString *os = 0x0;
525 for (ievt = 0; ievt < nEvents; ievt++) {
526 if (printNum&&(ievt%printNum==0)) {
527 AliInfo(Form("[%s] EventMixing %d/%d",GetName(),ievt,nEvents));
528 timer.Stop(); timer.Print(); timer.Start(kFALSE); fflush(stdout);
531 fEvBuffer->GetEntry(ievt);
532 AliRsnMiniEvent evMain(*fMiniEvent);
533 list = smatched[ievt].Tokenize("|");
534 TObjArrayIter next(list);
535 while ( (os = (TObjString *)next()) ) {
536 imix = os->GetString().Atoi();
537 fEvBuffer->GetEntry(imix);
538 for (idef = 0; idef < nDefs; idef++) {
539 def = (AliRsnMiniOutput *)fHistograms[idef];
541 if (!def->IsTrackPairMix()) continue;
542 ifill += def->FillPair(&evMain, fMiniEvent, &fValues, kTRUE);
543 if (!def->IsSymmetric()) {
544 AliDebugClass(2, "Reflecting non symmetric pair");
545 ifill += def->FillPair(fMiniEvent, &evMain, &fValues, kFALSE);
554 AliInfo(Form("[%s] EventMixing %d/%d",GetName(),nEvents,nEvents));
555 timer.Stop(); timer.Print(); fflush(stdout);
560 for (iloop = 1; iloop < nEvents; iloop++) {
562 // restart from beginning if reached last event
563 if (imix >= nEvents) imix -= nEvents;
564 // avoid to mix an event with itself
565 if (imix == ievt) continue;
566 // skip all events already mixed enough times
567 if (fNMixed[ievt] >= fNMix) break;
568 if (fNMixed[imix] >= fNMix) continue;
569 fEvBuffer->GetEntry(imix);
570 // skip if events are not matched
571 if (TMath::Abs(evMain.Vz() - fMiniEvent->Vz() ) > fMaxDiffVz ) continue;
572 if (TMath::Abs(evMain.Mult() - fMiniEvent->Mult() ) > fMaxDiffMult ) continue;
573 if (TMath::Abs(evMain.Angle() - fMiniEvent->Angle()) > fMaxDiffAngle) continue;
574 // found a match: increment counter for both events
575 AliDebugClass(1, Form("Event %d, def '%s': event mixing (%d with %d)", ievt, def->GetName(), ievt, imix));
579 ifill += def->FillPair(&evMain, fMiniEvent, &fValues);
580 // stop if mixed enough times
581 if (fNMixed[ievt] >= fNMix) break;
584 // print number of mixings done with each event
585 for (ievt = 0; ievt < nEvents; ievt++) {
586 AliDebugClass(2, Form("Event %6d: mixed %2d times", ievt, fNMixed[ievt]));
590 // post computed data
591 PostData(1, fOutput);
594 //__________________________________________________________________________________________________
595 void AliRsnMiniAnalysisTask::Terminate(Option_t *)
598 // Draw result to screen, or perform fitting, normalizations
599 // Called once at the end of the query
602 fOutput = dynamic_cast<TList *>(GetOutputData(1));
604 AliError("Could not retrieve TList fOutput");
609 //__________________________________________________________________________________________________
610 Char_t AliRsnMiniAnalysisTask::CheckCurrentEvent()
613 // This method checks if current event is OK for analysis.
614 // In case it is, the pointers of the local AliRsnEvent data member
615 // will point to it, in order to allow cut checking, otherwise the
616 // function exits with a failure message.
618 // ESD events must pass the physics selection, AOD are supposed to do.
620 // While checking the event, a histogram is filled to count the number
621 // of CINT1B, V0AND and CANDLE events, which are needed for normalization
623 // Return values can be:
624 // -- 'E' if the event is accepted and is ESD
625 // -- 'A' if the event is accepted and is AOD
626 // -- 0 if the event is not accepted
629 // string to sum messages
633 // exit points are provided in all cases an event is bad
634 // if this block is passed, an event can be rejected only
635 // if it does not pass the set of event cuts defined in the task
638 if (fInputEvent->InheritsFrom(AliESDEvent::Class())) {
641 // ESD specific check: Physics Selection
642 // --> if this is failed, the event is rejected
643 isSelected = (((AliInputEventHandler *)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fTriggerMask);
646 AliDebugClass(2, "Event does not pass physics selections");
647 fRsnEvent.SetRef(0x0);
648 fRsnEvent.SetRefMC(0x0);
651 // set reference to input
652 fRsnEvent.SetRef(fInputEvent);
653 // add MC if requested and available
656 fRsnEvent.SetRefMC(fMCEvent);
658 AliWarning("MC event requested but not available");
659 fRsnEvent.SetRefMC(0x0);
662 } else if (fInputEvent->InheritsFrom(AliAODEvent::Class())) {
665 // set reference to input
666 fRsnEvent.SetRef(fInputEvent);
667 // add MC if requested and available (it is in the same object)
669 fRsnEvent.SetRefMC(fInputEvent);
670 if (!fRsnEvent.GetAODList()) {
671 AliWarning("MC event requested but not available");
672 fRsnEvent.SetRefMC(0x0);
676 AliError(Form("Bad input event class: %s", fInputEvent->ClassName()));
677 // reset pointers in local AliRsnEvent object
678 fRsnEvent.SetRef(0x0);
679 fRsnEvent.SetRefMC(0x0);
683 // fill counter of accepted events
684 fHEventStat->Fill(0.1);
686 // check if it is V0AND
687 // --> uses a cast to AliESDEvent even if the input is an AliAODEvent
688 Bool_t v0A = fTriggerAna->IsOfflineTriggerFired((AliESDEvent *)fInputEvent, AliTriggerAnalysis::kV0A);
689 Bool_t v0C = fTriggerAna->IsOfflineTriggerFired((AliESDEvent *)fInputEvent, AliTriggerAnalysis::kV0C);
691 msg += " -- VOAND = YES";
692 fHEventStat->Fill(1.1);
694 msg += " -- VOAND = NO ";
698 // --> requires at least one good quality track with Pt > 0.5 and |eta| <= 0.8
699 Int_t iTrack, ntracksLoop = fInputEvent->GetNumberOfTracks();
700 Bool_t candle = kFALSE;
701 for (iTrack = 0; iTrack < ntracksLoop; iTrack++) {
702 AliVTrack *track = (AliVTrack *)fInputEvent->GetTrack(iTrack);
703 AliESDtrack *esdt = dynamic_cast<AliESDtrack *>(track);
704 AliAODTrack *aodt = dynamic_cast<AliAODTrack *>(track);
705 if (track->Pt() < 0.5) continue;
706 if(TMath::Abs(track->Eta()) > 0.8) continue;
707 if (esdt) if (!fESDtrackCuts->AcceptTrack(esdt)) continue;
708 if (aodt) if (!aodt->TestFilterBit(5)) continue;
713 msg += " -- CANDLE = YES";
714 fHEventStat->Fill(2.1);
716 msg += " -- CANDLE = NO ";
719 // if event cuts are defined, they are checked here
720 // final decision on the event depends on this
723 if (!fEventCuts->IsSelected(&fRsnEvent)) {
724 msg += " -- Local cuts = REJECTED";
727 msg += " -- Local cuts = ACCEPTED";
731 msg += " -- Local cuts = NONE";
735 // if the above exit point is not taken, the event is accepted
736 AliDebugClass(2, Form("Stats: %s", msg.Data()));
738 fHEventStat->Fill(3.1);
739 Double_t multi = ComputeCentrality((output == 'E'));
740 fHAEventsVsMulti->Fill(multi);
741 if(fHAEventVz) fHAEventVz->Fill(multi,fInputEvent->GetPrimaryVertex()->GetZ());
742 if(fHAEventMultiCent) fHAEventMultiCent->Fill(multi,ComputeMultiplicity(output == 'E',fHAEventMultiCent->GetYaxis()->GetTitle()));
743 if(fHAEventPlane) fHAEventPlane->Fill(multi,ComputeAngle());
750 //__________________________________________________________________________________________________
751 void AliRsnMiniAnalysisTask::FillMiniEvent(Char_t evType)
754 // Refresh cursor mini-event data member to fill with current event.
755 // Returns the total number of tracks selected.
758 // assign event-related values
759 if (fMiniEvent) delete fMiniEvent;
760 fMiniEvent = new AliRsnMiniEvent;
761 fMiniEvent->Vz() = fInputEvent->GetPrimaryVertex()->GetZ();
762 fMiniEvent->Angle() = ComputeAngle();
763 fMiniEvent->Mult() = ComputeCentrality((evType == 'E'));
764 AliDebugClass(2, Form("Event %d: type = %c -- vz = %f -- mult = %f -- angle = %f", fEvNum, evType, fMiniEvent->Vz(), fMiniEvent->Mult(), fMiniEvent->Angle()));
766 // loop on daughters and assign track-related values
767 Int_t ic, ncuts = fTrackCuts.GetEntries();
768 Int_t ip, npart = fRsnEvent.GetAbsoluteSum();
769 Int_t npos = 0, nneg = 0, nneu = 0;
770 AliRsnDaughter cursor;
771 AliRsnMiniParticle miniParticle;
772 for (ip = 0; ip < npart; ip++) {
773 // point cursor to next particle
774 fRsnEvent.SetDaughter(cursor, ip);
775 // copy momentum and MC info if present
776 miniParticle.CopyDaughter(&cursor);
777 miniParticle.Index() = ip;
778 // switch on the bits corresponding to passed cuts
779 for (ic = 0; ic < ncuts; ic++) {
780 AliRsnCutSet *cuts = (AliRsnCutSet *)fTrackCuts[ic];
781 if (cuts->IsSelected(&cursor)) miniParticle.SetCutBit(ic);
783 // if a track passes at least one track cut, it is added to the pool
784 if (miniParticle.CutBits()) {
785 fMiniEvent->AddParticle(miniParticle);
786 if (miniParticle.Charge() == '+') npos++;
787 else if (miniParticle.Charge() == '-') nneg++;
792 // get number of accepted tracks
793 AliDebugClass(1, Form("Event %6d: total = %5d, accepted = %4d (pos %4d, neg %4d, neu %4d)", fEvNum, npart, (Int_t)fMiniEvent->Particles().GetEntriesFast(), npos, nneg, nneu));
796 //__________________________________________________________________________________________________
797 Double_t AliRsnMiniAnalysisTask::ComputeAngle()
800 // Get the plane angle
803 AliEventplane *plane = 0x0;
805 if (fInputEvent->InheritsFrom(AliESDEvent::Class()))
806 plane = fInputEvent->GetEventplane();
807 else if (fInputEvent->InheritsFrom(AliAODEvent::Class())) {
808 AliAODEvent *aodEvent = (AliAODEvent *)fInputEvent;
809 plane = aodEvent->GetHeader()->GetEventplaneP();
813 return plane->GetEventplane("Q");
815 AliWarning("No event plane defined");
820 //__________________________________________________________________________________________________
821 Double_t AliRsnMiniAnalysisTask::ComputeCentrality(Bool_t isESD)
824 // Computes event centrality/multiplicity according to the criterion defined
825 // by two elements: (1) choice between multiplicity and centrality and
826 // (2) the string defining what criterion must be used for specific computation.
829 if (fUseCentrality) {
830 if ((!fUseMC) && (fUseCentralityPatchPbPb2011)) {
831 return ApplyCentralityPatchPbPb2011();//
833 if ((!fUseMC) && (!isESD) && (fUseAOD049CentralityPatch)) {
834 return ApplyCentralityPatchAOD049();
836 AliCentrality *centrality = fInputEvent->GetCentrality();
838 AliError("Cannot compute centrality!");
841 return centrality->GetCentralityPercentile(fCentralityType.Data());
844 if (!fCentralityType.CompareTo("TRACKS"))
845 return fInputEvent->GetNumberOfTracks();
846 else if (!fCentralityType.CompareTo("QUALITY"))
848 return AliESDtrackCuts::GetReferenceMultiplicity((AliESDEvent *)fInputEvent, kTRUE);
851 Int_t iTrack, ntracksLoop = fInputEvent->GetNumberOfTracks();
852 for (iTrack = 0; iTrack < ntracksLoop; iTrack++) {
853 AliVTrack *track = (AliVTrack *)fInputEvent->GetTrack(iTrack);
854 AliAODTrack *aodt = dynamic_cast<AliAODTrack *>(track);
856 if (!aodt->TestFilterBit(5)) continue;
861 else if (!fCentralityType.CompareTo("TRACKLETS")) {
863 const AliMultiplicity *mult = ((AliESDEvent *)fInputEvent)->GetMultiplicity();
864 Float_t nClusters[6] = {0.0,0.0,0.0,0.0,0.0,0.0};
865 for(Int_t ilay = 0; ilay < 6; ilay++) nClusters[ilay] = (Float_t)mult->GetNumberOfITSClusters(ilay);
866 return AliESDUtils::GetCorrSPD2(nClusters[1], fInputEvent->GetPrimaryVertex()->GetZ());
868 AliWarning("Cannot compute multiplicity with SPD tracklets from AOD");
872 AliError(Form("String '%s' does not define a possible multiplicity/centrality computation", fCentralityType.Data()));
878 //__________________________________________________________________________________________________
879 Double_t AliRsnMiniAnalysisTask::ComputeMultiplicity(Bool_t isESD,TString type)
882 // Computes event multiplicity according to the string defining
883 // what criterion must be used for specific computation.
888 if (!type.CompareTo("TRACKS"))
889 return fInputEvent->GetNumberOfTracks();
890 else if (!type.CompareTo("QUALITY"))
892 return AliESDtrackCuts::GetReferenceMultiplicity((AliESDEvent *)fInputEvent, kTRUE);
895 Int_t iTrack, ntracksLoop = fInputEvent->GetNumberOfTracks();
896 for (iTrack = 0; iTrack < ntracksLoop; iTrack++) {
897 AliVTrack *track = (AliVTrack *)fInputEvent->GetTrack(iTrack);
898 AliAODTrack *aodt = dynamic_cast<AliAODTrack *>(track);
900 if (!aodt->TestFilterBit(5)) continue;
905 else if (!type.CompareTo("TRACKLETS")) {
907 const AliMultiplicity *mult = ((AliESDEvent *)fInputEvent)->GetMultiplicity();
908 Float_t nClusters[6] = {0.0,0.0,0.0,0.0,0.0,0.0};
909 for(Int_t ilay = 0; ilay < 6; ilay++) nClusters[ilay] = (Float_t)mult->GetNumberOfITSClusters(ilay);
910 return AliESDUtils::GetCorrSPD2(nClusters[1], fInputEvent->GetPrimaryVertex()->GetZ());
912 AliWarning("Cannot compute multiplicity with SPD tracklets from AOD");
916 AliError(Form("String '%s' does not define a possible multiplicity/centrality computation", type.Data()));
921 //__________________________________________________________________________________________________
922 void AliRsnMiniAnalysisTask::FillTrueMotherESD(AliRsnMiniEvent *miniEvent)
925 // Fills the histograms with true mother (ESD version)
929 Int_t id, ndef = fHistograms.GetEntries();
930 Int_t ip, label1, label2, npart = fMCEvent->GetNumberOfTracks();
931 static AliRsnMiniPair miniPair;
932 AliMCParticle *daughter1, *daughter2;
933 TLorentzVector p1, p2;
934 AliRsnMiniOutput *def = 0x0;
936 for (id = 0; id < ndef; id++) {
937 def = (AliRsnMiniOutput *)fHistograms[id];
939 if (!def->IsMother()) continue;
940 for (ip = 0; ip < npart; ip++) {
941 AliMCParticle *part = (AliMCParticle *)fMCEvent->GetTrack(ip);
942 //get mother pdg code
943 if (part->Particle()->GetPdgCode() != def->GetMotherPDG()) continue;
944 // check that daughters match expected species
945 if (part->Particle()->GetNDaughters() < 2) continue;
946 if (fMaxNDaughters > 0 && part->Particle()->GetNDaughters() > fMaxNDaughters) continue;
947 label1 = part->Particle()->GetDaughter(0);
948 label2 = part->Particle()->GetDaughter(1);
949 daughter1 = (AliMCParticle *)fMCEvent->GetTrack(label1);
950 daughter2 = (AliMCParticle *)fMCEvent->GetTrack(label2);
952 if (TMath::Abs(daughter1->Particle()->GetPdgCode()) == def->GetPDG(0) && TMath::Abs(daughter2->Particle()->GetPdgCode()) == def->GetPDG(1)) {
954 p1.SetXYZM(daughter1->Px(), daughter1->Py(), daughter1->Pz(), def->GetMass(0));
955 p2.SetXYZM(daughter2->Px(), daughter2->Py(), daughter2->Pz(), def->GetMass(1));
956 } else if (TMath::Abs(daughter1->Particle()->GetPdgCode()) == def->GetPDG(1) && TMath::Abs(daughter2->Particle()->GetPdgCode()) == def->GetPDG(0)) {
958 p1.SetXYZM(daughter1->Px(), daughter1->Py(), daughter1->Pz(), def->GetMass(1));
959 p2.SetXYZM(daughter2->Px(), daughter2->Py(), daughter2->Pz(), def->GetMass(0));
961 if (!okMatch) continue;
962 if(fCheckP && (TMath::Abs(part->Px()-(daughter1->Px()+daughter2->Px()))/(TMath::Abs(part->Px())+1.e-13)) > 0.00001 &&
963 (TMath::Abs(part->Py()-(daughter1->Py()+daughter2->Py()))/(TMath::Abs(part->Py())+1.e-13)) > 0.00001 &&
964 (TMath::Abs(part->Pz()-(daughter1->Pz()+daughter2->Pz()))/(TMath::Abs(part->Pz())+1.e-13)) > 0.00001 ) continue;
968 mother = part->GetMother();
970 Int_t abspdgGranma =0;
971 Bool_t isFromB=kFALSE;
972 Bool_t isQuarkFound=kFALSE;
975 AliDebug(2,Form("mother at step %d = %d", istep, mother));
976 AliMCParticle* mcGranma = dynamic_cast<AliMCParticle*>(fMCEvent->GetTrack(mother));
978 pdgGranma = mcGranma->PdgCode();
979 AliDebug(2,Form("Pdg mother at step %d = %d", istep, pdgGranma));
980 abspdgGranma = TMath::Abs(pdgGranma);
981 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
984 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
985 mother = mcGranma->GetMother();
987 AliError("Failed casting the mother particle!");
991 if(fRejectIfNoQuark && !isQuarkFound) pdgGranma = -99999;
993 if (!fKeepDfromB) pdgGranma = -9999; //skip particle if come from a B meson.
996 if (fKeepDfromBOnly) pdgGranma = -999;
998 if (pdgGranma == -99999){
999 AliDebug(2,"This particle does not have a quark in his genealogy\n");
1002 if (pdgGranma == -9999){
1003 AliDebug(2,"This particle come from a B decay channel but according to the settings of the task, we keep only the prompt charm particles\n");
1007 if (pdgGranma == -999){
1008 AliDebug(2,"This particle come from a prompt charm particles but according to the settings of the task, we want only the ones coming from B\n");
1014 // assign momenta to computation object
1015 miniPair.Sum(0) = miniPair.Sum(1) = (p1 + p2);
1016 miniPair.FillRef(def->GetMotherMass());
1018 def->FillMother(&miniPair, miniEvent, &fValues);
1023 //__________________________________________________________________________________________________
1024 void AliRsnMiniAnalysisTask::FillTrueMotherAOD(AliRsnMiniEvent *miniEvent)
1027 // Fills the histograms with true mother (AOD version)
1031 TClonesArray *list = fRsnEvent.GetAODList();
1032 Int_t id, ndef = fHistograms.GetEntries();
1033 Int_t ip, label1, label2, npart = list->GetEntries();
1034 static AliRsnMiniPair miniPair;
1035 AliAODMCParticle *daughter1, *daughter2;
1036 TLorentzVector p1, p2;
1037 AliRsnMiniOutput *def = 0x0;
1039 for (id = 0; id < ndef; id++) {
1040 def = (AliRsnMiniOutput *)fHistograms[id];
1042 if (!def->IsMother()) continue;
1043 for (ip = 0; ip < npart; ip++) {
1044 AliAODMCParticle *part = (AliAODMCParticle *)list->At(ip);
1045 if (part->GetPdgCode() != def->GetMotherPDG()) continue;
1046 // check that daughters match expected species
1047 if (part->GetNDaughters() < 2) continue;
1048 if (fMaxNDaughters > 0 && part->GetNDaughters() > fMaxNDaughters) continue;
1049 label1 = part->GetDaughter(0);
1050 label2 = part->GetDaughter(1);
1051 daughter1 = (AliAODMCParticle *)list->At(label1);
1052 daughter2 = (AliAODMCParticle *)list->At(label2);
1054 if (TMath::Abs(daughter1->GetPdgCode()) == def->GetPDG(0) && TMath::Abs(daughter2->GetPdgCode()) == def->GetPDG(1)) {
1056 p1.SetXYZM(daughter1->Px(), daughter1->Py(), daughter1->Pz(), def->GetMass(0));
1057 p2.SetXYZM(daughter2->Px(), daughter2->Py(), daughter2->Pz(), def->GetMass(1));
1058 } else if (TMath::Abs(daughter1->GetPdgCode()) == def->GetPDG(1) && TMath::Abs(daughter2->GetPdgCode()) == def->GetPDG(0)) {
1060 p1.SetXYZM(daughter1->Px(), daughter1->Py(), daughter1->Pz(), def->GetMass(1));
1061 p2.SetXYZM(daughter2->Px(), daughter2->Py(), daughter2->Pz(), def->GetMass(0));
1063 if (!okMatch) continue;
1064 if(fCheckP && (TMath::Abs(part->Px()-(daughter1->Px()+daughter2->Px()))/(TMath::Abs(part->Px())+1.e-13)) > 0.00001 &&
1065 (TMath::Abs(part->Py()-(daughter1->Py()+daughter2->Py()))/(TMath::Abs(part->Py())+1.e-13)) > 0.00001 &&
1066 (TMath::Abs(part->Pz()-(daughter1->Pz()+daughter2->Pz()))/(TMath::Abs(part->Pz())+1.e-13)) > 0.00001 ) continue;
1068 Int_t pdgGranma = 0;
1070 mother = part->GetMother();
1072 Int_t abspdgGranma =0;
1073 Bool_t isFromB=kFALSE;
1074 Bool_t isQuarkFound=kFALSE;
1075 while (mother >=0 ){
1077 AliDebug(2,Form("mother at step %d = %d", istep, mother));
1078 AliAODMCParticle* mcGranma = dynamic_cast<AliAODMCParticle*>(list->At(mother));
1080 pdgGranma = mcGranma->GetPdgCode();
1081 AliDebug(2,Form("Pdg mother at step %d = %d", istep, pdgGranma));
1082 abspdgGranma = TMath::Abs(pdgGranma);
1083 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
1086 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
1087 mother = mcGranma->GetMother();
1089 AliError("Failed casting the mother particle!");
1093 if(fRejectIfNoQuark && !isQuarkFound) pdgGranma = -99999;
1095 if (!fKeepDfromB) pdgGranma = -9999; //skip particle if come from a B meson.
1098 if (fKeepDfromBOnly) pdgGranma = -999;
1101 if (pdgGranma == -99999){
1102 AliDebug(2,"This particle does not have a quark in his genealogy\n");
1105 if (pdgGranma == -9999){
1106 AliDebug(2,"This particle come from a B decay channel but according to the settings of the task, we keep only the prompt charm particles\n");
1110 if (pdgGranma == -999){
1111 AliDebug(2,"This particle come from a prompt charm particles but according to the settings of the task, we want only the ones coming from B\n");
1115 // assign momenta to computation object
1116 miniPair.Sum(0) = miniPair.Sum(1) = (p1 + p2);
1117 miniPair.FillRef(def->GetMotherMass());
1119 def->FillMother(&miniPair, miniEvent, &fValues);
1123 //___________________________________________________________
1124 void AliRsnMiniAnalysisTask::SetDselection(UShort_t originDselection)
1126 // setting the way the D0 will be selected
1127 // 0 --> only from c quarks
1128 // 1 --> only from b quarks
1129 // 2 --> from both c quarks and b quarks
1131 fOriginDselection = originDselection;
1133 if (fOriginDselection == 0) {
1134 fKeepDfromB = kFALSE;
1135 fKeepDfromBOnly = kFALSE;
1138 if (fOriginDselection == 1) {
1139 fKeepDfromB = kTRUE;
1140 fKeepDfromBOnly = kTRUE;
1143 if (fOriginDselection == 2) {
1144 fKeepDfromB = kTRUE;
1145 fKeepDfromBOnly = kFALSE;
1150 //__________________________________________________________________________________________________
1151 Bool_t AliRsnMiniAnalysisTask::EventsMatch(AliRsnMiniEvent *event1, AliRsnMiniEvent *event2)
1154 // Check if two events are compatible.
1155 // If the mixing is continuous, this is true if differences in vz, mult and angle are smaller than
1156 // the specified values.
1157 // If the mixing is binned, this is true if the events are in the same bin.
1160 if (!event1 || !event2) return kFALSE;
1161 Int_t ivz1, ivz2, imult1, imult2, iangle1, iangle2;
1162 Double_t dv, dm, da;
1164 if (fContinuousMix) {
1165 dv = TMath::Abs(event1->Vz() - event2->Vz() );
1166 dm = TMath::Abs(event1->Mult() - event2->Mult() );
1167 da = TMath::Abs(event1->Angle() - event2->Angle());
1168 if (dv > fMaxDiffVz) {
1169 //AliDebugClass(2, Form("Events #%4d and #%4d don't match due to a too large diff in Vz = %f", event1->ID(), event2->ID(), dv));
1172 if (dm > fMaxDiffMult ) {
1173 //AliDebugClass(2, Form("Events #%4d and #%4d don't match due to a too large diff in Mult = %f", event1->ID(), event2->ID(), dm));
1176 if (da > fMaxDiffAngle) {
1177 //AliDebugClass(2, Form("Events #%4d and #%4d don't match due to a too large diff in Angle = %f", event1->ID(), event2->ID(), da));
1182 ivz1 = (Int_t)(event1->Vz() / fMaxDiffVz);
1183 ivz2 = (Int_t)(event2->Vz() / fMaxDiffVz);
1184 imult1 = (Int_t)(event1->Mult() / fMaxDiffMult);
1185 imult2 = (Int_t)(event2->Mult() / fMaxDiffMult);
1186 iangle1 = (Int_t)(event1->Angle() / fMaxDiffAngle);
1187 iangle2 = (Int_t)(event2->Angle() / fMaxDiffAngle);
1188 if (ivz1 != ivz2) return kFALSE;
1189 if (imult1 != imult2) return kFALSE;
1190 if (iangle1 != iangle2) return kFALSE;
1195 //---------------------------------------------------------------------
1196 Double_t AliRsnMiniAnalysisTask::ApplyCentralityPatchPbPb2011(){
1197 //This part rejects randomly events such that the centrality gets flat for LHC11h Pb-Pb data
1198 //for 0-5% and 10-20% centrality bin
1200 if (fCentralityType!="V0M") {
1201 AliWarning("Wrong value (not centrality from V0).");
1205 AliCentrality *centrality = fInputEvent->GetCentrality();
1207 AliWarning("Cannot get centrality from AOD event.");
1211 Double_t cent = (Float_t)(centrality->GetCentralityPercentile("V0M"));
1212 Double_t rnd_hc = -1., testf = 0.0, ff = 0, N1 = -1., N2 = -1.;
1214 if(fUseCentralityPatchPbPb2011==510){
1216 N2 = 1.56435e+06; //N2 is the reference
1217 ff = 5.04167e+06 - 1.49885e+06*cent + 2.35998e+05*cent*cent -1.22873e+04*cent*cent*cent;
1219 if(fUseCentralityPatchPbPb2011==1020){
1220 N2 = 2.0e+05; //N2 is the reference
1222 ff = -1.73979e+06 - 3.05316e+06*cent + 1.05517e+06*cent*cent - 133205*cent*cent*cent + 8187.45*cent*cent*cent*cent - 247.875*cent*cent*cent*cent*cent + 2.9676*cent*cent*cent*cent*cent*cent;
1224 AliError(Form("Patch for the requested centrality (%i) is not available", fUseCentralityPatchPbPb2011));
1228 testf = ( N2 + (N1-ff) ) / N1;
1229 rnd_hc = gRandom->Rndm();
1231 //AliDebugClass(1, Form("Flat Centrality %d", fUseCentralityPatchPbPb2011));
1233 if (rnd_hc < 0 || rnd_hc > 1 )
1235 AliWarning("Wrong Random number generated");
1244 //---------------------------------------------------------------------
1245 Double_t AliRsnMiniAnalysisTask::ApplyCentralityPatchAOD049()
1248 //Apply centrality patch for AOD049 outliers
1250 if (fInputEvent->InheritsFrom(AliESDEvent::Class())) {
1251 AliWarning("Requested patch for AOD049 for ESD. ");
1255 if (fCentralityType!="V0M") {
1256 AliWarning("Requested patch forAOD049 for wrong value (not centrality from V0).");
1260 AliCentrality *centrality = fInputEvent->GetCentrality();
1262 AliWarning("Cannot get centrality from AOD event.");
1266 Float_t cent = (Float_t)(centrality->GetCentralityPercentile("V0M"));
1268 Bool_t isSelRun = kFALSE;
1269 Int_t selRun[5] = {138364, 138826, 138828, 138836, 138871};
1271 Int_t quality = centrality->GetQuality();
1273 cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0M");
1275 Int_t runnum=aodEvent->GetRunNumber();
1276 for(Int_t ir=0;ir<5;ir++){
1277 if(runnum==selRun[ir]){
1282 if((quality==8||quality==9)&&isSelRun) cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0M");
1289 AliAODEvent *aodEvent = (AliAODEvent *)fInputEvent;
1290 AliAODVZERO *aodV0 = (AliAODVZERO *) aodEvent->GetVZEROData();
1291 v0+=aodV0->GetMTotV0A();
1292 v0+=aodV0->GetMTotV0C();
1293 if ( (cent==0) && (v0<19500) ) {
1294 AliDebug(3, Form("Filtering issue in centrality -> cent = %5.2f",cent));
1297 Float_t tkl = (Float_t)(aodEvent->GetTracklets()->GetNumberOfTracklets());
1298 Float_t val = 1.30552 + 0.147931 * v0;
1300 Float_t tklSigma[101] = {176.644, 156.401, 153.789, 153.015, 142.476, 137.951, 136.127, 129.852, 127.436, 124.86,
1301 120.788, 115.611, 113.172, 110.496, 109.127, 104.421, 102.479, 99.9766, 97.5152, 94.0654,
1302 92.4602, 89.3364, 87.1342, 83.3497, 82.6216, 81.1084, 78.0793, 76.1234, 72.9434, 72.1334,
1303 68.0056, 68.2755, 66.0376, 62.9666, 62.4274, 59.65, 58.3776, 56.6361, 54.5184, 53.4224,
1304 51.932, 50.8922, 48.2848, 47.912, 46.5717, 43.4114, 43.2083, 41.3065, 40.1863, 38.5255,
1305 37.2851, 37.5396, 34.4949, 33.8366, 31.8043, 31.7412, 30.8392, 30.0274, 28.8793, 27.6398,
1306 26.6488, 25.0183, 25.1489, 24.4185, 22.9107, 21.2002, 21.6977, 20.1242, 20.4963, 19.0235,
1307 19.298, 17.4103, 16.868, 15.2939, 15.2939, 16.0295, 14.186, 14.186, 15.2173, 12.9504, 12.9504,
1308 12.9504, 15.264, 12.3674, 12.3674, 12.3674, 12.3674, 12.3674, 18.3811, 13.7544, 13.7544,
1309 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544
1312 if ( TMath::Abs(tkl-val) > 6.*tklSigma[(Int_t)cent] ) {
1313 AliDebug(3, Form("Outlier event in centrality -> cent = %5.2f",cent));
1317 //force it to be -999. whatever the negative value was
1323 //----------------------------------------------------------------------------------
1324 void AliRsnMiniAnalysisTask::SetEventQAHist(TString type,TH2F *histo)
1327 AliWarning(Form("event QA histogram pointer not defined for slot %s",type.Data()));
1333 if(!type.CompareTo("vz")) fHAEventVz = histo;
1334 else if(!type.CompareTo("multicent")) {
1335 TString mtype(histo->GetYaxis()->GetTitle());
1337 if(mtype.CompareTo("QUALITY") && mtype.CompareTo("TRACKS") && mtype.CompareTo("TRACKLETS")) {
1338 AliWarning(Form("multiplicity vs. centrality histogram y-axis %s unknown, setting to TRACKS",mtype.Data()));
1339 histo->GetYaxis()->SetTitle("TRACKS");
1341 fHAEventMultiCent = histo;
1343 else if(!type.CompareTo("eventplane")) fHAEventPlane = histo;
1344 else AliWarning(Form("event QA histogram slot %s undefined",type.Data()));
1349 //----------------------------------------------------------------------------------
1350 Int_t AliRsnMiniAnalysisTask::CreateValue(AliRsnMiniValue::EType type, Bool_t useMC)
1353 // Create a new value in the task,
1354 // and returns its ID, which is needed for setting up histograms.
1355 // If that value was already initialized, returns its ID and does not recreate it.
1358 Int_t valID = ValueID(type, useMC);
1359 if (valID >= 0 && valID < fValues.GetEntries()) {
1360 AliInfo(Form("Value '%s' is already created in slot #%d", AliRsnMiniValue::ValueName(type, useMC), valID));
1362 valID = fValues.GetEntries();
1363 AliInfo(Form("Creating value '%s' in slot #%d", AliRsnMiniValue::ValueName(type, useMC), valID));
1364 new (fValues[valID]) AliRsnMiniValue(type, useMC);
1370 //----------------------------------------------------------------------------------
1371 Int_t AliRsnMiniAnalysisTask::ValueID(AliRsnMiniValue::EType type, Bool_t useMC)
1374 // Searches if a value computation is initialized
1377 const char *name = AliRsnMiniValue::ValueName(type, useMC);
1378 TObject *obj = fValues.FindObject(name);
1380 return fValues.IndexOf(obj);
1385 //----------------------------------------------------------------------------------
1386 AliRsnMiniOutput *AliRsnMiniAnalysisTask::CreateOutput(const char *name, AliRsnMiniOutput::EOutputType type, AliRsnMiniOutput::EComputation src)
1389 // Create a new histogram definition in the task,
1390 // which is then returned to the user for its configuration
1393 Int_t n = fHistograms.GetEntries();
1394 AliRsnMiniOutput *newDef = new (fHistograms[n]) AliRsnMiniOutput(name, type, src);
1399 //----------------------------------------------------------------------------------
1400 AliRsnMiniOutput *AliRsnMiniAnalysisTask::CreateOutput(const char *name, const char *outType, const char *compType)
1403 // Create a new histogram definition in the task,
1404 // which is then returned to the user for its configuration
1407 Int_t n = fHistograms.GetEntries();
1408 AliRsnMiniOutput *newDef = new (fHistograms[n]) AliRsnMiniOutput(name, outType, compType);