AliDebug(AliLog::kDebug+2,"<-");
// get number of steps and axes
- Int_t iaxis;
+ Int_t iaxis = 0;
Int_t nAxes = fAxisList.GetEntries();
Int_t nSteps = (Int_t)fStepListMC.GetEntries() + (Int_t)fStepListESD.GetEntries();
fVar.Set(nAxes);
// retrieve number of bins for each axis
- Int_t *nBins = new Int_t[nAxes];
- TArrayD *array = new TArrayD[nAxes];
+ Int_t *nBins = new Int_t[nAxes];
for (iaxis = 0; iaxis < nAxes; iaxis++)
{
AliRsnValue *fcnAxis = (AliRsnValue*)fAxisList.At(iaxis);
- fcnAxis->Print();
- array[iaxis] = fcnAxis->GetArray();
- nBins[iaxis] = array[iaxis].GetSize() - 1;
+ nBins[iaxis] = fcnAxis->GetArray().GetSize() - 1;
}
// create ouput list of containers
fOutList->SetOwner();
// create the containers
- Int_t i, nDef = (Int_t)fPairDefList.GetEntries();
+ Int_t i = 0, nDef = (Int_t)fPairDefList.GetEntries();
for (i = 0; i < nDef; i++)
{
AliRsnPairDef *def = (AliRsnPairDef*)fPairDefList[i];
AliCFContainer *cont = new AliCFContainer(Form("%s", def->GetPairName()), "", nSteps, nAxes, nBins);
// set the bin limits for each axis
- for (iaxis = 0; iaxis < nAxes; iaxis++) cont->SetBinLimits(iaxis, array[iaxis].GetArray());
+ for (iaxis = 0; iaxis < nAxes; iaxis++)
+ {
+ AliRsnValue *fcnAxis = (AliRsnValue*)fAxisList.At(iaxis);
+ cont->SetBinLimits(iaxis, fcnAxis->GetArray().GetArray());
+ }
// add the container to output list
fContainerList->Add(cont);
}
fOutList->Print();
PostData(2, fOutList);
+
+ // clear heap
+ delete [] nBins;
AliDebug(AliLog::kDebug+2,"->");
}
// retrieve ESD event and related stack (if available)
AliESDEvent *esd = dynamic_cast<AliESDEvent*>(fInputEvent);
- AliStack *stack = (fMCEvent ? fMCEvent->Stack() : 0x0);
+ AliStack *stack = 0x0;
+
+ // skip NULL events
+ if (!esd) return;
+ if (fMCEvent) stack = fMCEvent->Stack();
// check the event
EventEval(esd);
Char_t target[100];
switch (fTarget)
{
- case kDaughter: sprintf(target, "DAUGHTER"); break;
- case kMother : sprintf(target, "MOTHER"); break;
- case kEvent : sprintf(target, "EVENT"); break;
- case kMixEvent: sprintf(target, "MIX EVENT"); break;
- default : sprintf(target, "UNDEFINED"); break;
+ case kDaughter: snprintf(target, strlen("DAUGHTER") , "DAUGHTER") ; break;
+ case kMother : snprintf(target, strlen("MOTHER") , "MOTHER") ; break;
+ case kEvent : snprintf(target, strlen("EVENT") , "EVENT") ; break;
+ case kMixEvent: snprintf(target, strlen("MIX EVENT"), "MIX EVENT"); break;
+ default : snprintf(target, strlen("UNDEFINED"), "UNDEFINED"); break;
}
AliInfo("=== CUT DETAILS ====================================");
// Cut checker.
//
- // coherence check
- if (!AliRsnCut::TargetOK(obj1))
+ // dynamic cast the object into AliRsnDaughter
+ AliRsnDaughter *track = dynamic_cast<AliRsnDaughter*>(obj1);
+ if (!track)
{
- AliError(Form("Wrong target '%s'. Skipping cut", GetName()));
+ AliError(Form("[%s]: this cut works only with AliRsnDaughter objects", GetName()));
return kTRUE;
}
-
- // dynamic cast the object into AliRsnDaughter
- AliRsnDaughter *track = dynamic_cast<AliRsnDaughter*>(obj1);
// retrieve the TPC signal
AliESDtrack *esd = track->GetRefESDtrack();
case kTrackTPC:
return ((status & AliESDtrack::kTPCin) != 0);
case kTrackITSSA:
- if (esdT)
+ if (esdT && track)
{
UChar_t itsCluMap = track->GetITSClusterMap();
Int_t k, nITS = 0;
//
// Default constructor.
//
+
+ Int_t i = 0;
+ for (i = 0; i < 5; i++) fTPCpar[i] = 0.0;
}
//_________________________________________________________________________________________________
//
// Main constructor.
//
+
+ Int_t i = 0;
+ for (i = 0; i < 5; i++) fTPCpar[i] = 0.0;
}
//_________________________________________________________________________________________________
//
// Main constructor.
//
+
+ Int_t i = 0;
+ for (i = 0; i < 5; i++) fTPCpar[i] = copy.fTPCpar[i];
}
//_________________________________________________________________________________________________
//
// Cut checker.
//
-
- // coherence check
- if (!AliRsnCut::TargetOK(obj1))
- {
- AliError(Form("Wrong target '%s'. Skipping cut", GetName()));
- return kTRUE;
- }
// convert the object into the unique correct type
AliRsnDaughter *daughter = dynamic_cast<AliRsnDaughter*>(obj1);
+ if (!daughter)
+ {
+ AliError(Form("[%s]: this cut works only with AliRsnDaughter objects", GetName()));
+ return kTRUE;
+ }
// depending on the PID type, recalls the appropriate method:
// in case of perfect PID, checks only if the PID type is
//
Char_t type[50], source[50];
- if (IsTrack()) sprintf(type, "track");
- else if (IsV0()) sprintf(type, "V0");
- else sprintf(type, "none");
+ if (IsTrack()) snprintf(type, 5, "track");
+ else if (IsV0()) snprintf(type, 2, "V0");
+ else snprintf(type, 4, "none");
- if (IsESD()) sprintf(source, "ESD");
- else if (IsAOD()) sprintf(source, "AOD");
- else if (fRefMC != 0x0) sprintf(source, "MC only");
- else sprintf(source, "none");
+ if (IsESD()) snprintf(source, 3, "ESD");
+ else if (IsAOD()) snprintf(source, 3, "AOD");
+ else if (fRefMC != 0x0) snprintf(source, 7, "MC only");
+ else snprintf(source, 4, "none");
AliInfo("===== ALIRSNDAUGHTER INFORMATION ==============================================");
AliInfo(Form(".......Index : %d", GetID()));
return kFALSE;
}
AliVTrack *track = (AliVTrack*)fRef->GetTrack(i);
- label = TMath::Abs(track->GetLabel());
if (!track)
{
out.SetBad();
}
else
{
+ label = TMath::Abs(track->GetLabel());
out.SetRef(track);
out.SetLabel(label);
if (fRefMC)
angleRMS = TMath::Sqrt(angle2Mean - angleMean * angleMean);
return kTRUE;
-}
\ No newline at end of file
+}
AliRsnValue *fcnAxis = 0;
for (i = 0; i < fSize; i++) {
fcnAxis = (AliRsnValue*)fAxisList.At(i);
- if (!fcnAxis) {
+ if (!fcnAxis)
+ {
values[i] = 0.0;
continue;
}
{
// check presence of output histogram
if (!fH1) {
- AliError("Required a TH1 whish is not initialized");
+ AliError("Required a TH1 which is not initialized");
+ delete [] values;
return kFALSE;
}
break;
default:
AliError(Form("Wrong size : %d", fSize));
+ delete [] values;
return kFALSE;
}
}
AliDebug(AliLog::kDebug+2,"<-");
Int_t i;
- Char_t hName[255];
+ TString hName("");
AliRsnFunction *fcn = 0;
for (i = 0; i < fFunctions.GetEntries(); i++)
{
fcn = (AliRsnFunction*)fFunctions.At(i);
- sprintf(hName, "%s_%s_%s", prefix, GetName(), fcn->GetName());
-
- if (fcn->IsUsingTH1()) list->Add(fcn->CreateHistogram(hName, ""));
- else list->Add(fcn->CreateHistogramSparse(hName, ""));
+ hName += prefix;
+ hName += '_';
+ hName += GetName();
+ hName += '_';
+ hName += fcn->GetName();
+ if (fcn->IsUsingTH1()) list->Add(fcn->CreateHistogram(hName.Data(), ""));
+ else list->Add(fcn->CreateHistogramSparse(hName.Data(), ""));
}
AliDebug(AliLog::kDebug+2,"->");
while(fValue >= TMath::Pi()) fValue -= 2*TMath::Pi();
while(fValue < -0.5*TMath::Pi()) fValue += 2*TMath::Pi();
//Printf("%g", fValue);
-
}
break;
case kEventMult:
- if (!event) fValue = 0.0;
- fValue = (Double_t)event->GetMultiplicity();
+ if (!event)
+ {
+ fValue = 0.0;
+ return kFALSE;
+ }
+ else fValue = (Double_t)event->GetMultiplicity();
break;
case kLeadingPt:
+ if (!event)
+ {
+ fValue = 0.0;
+ return kFALSE;
+ }
+ else
{
int leadingID = event->SelectLeadingParticle(0);
if(leadingID >= 0) {
switch (fType)
{
+ case kEventMult:
+ if (!event)
+ {
+ fValue = 0.0;
+ return kFALSE;
+ }
+ else fValue = (Double_t)event->GetMultiplicity();
+ break;
+ case kLeadingPt:
+ if (!event)
+ {
+ fValue = 0.0;
+ return kFALSE;
+ }
+ else
+ {
+ int leadingID = event->SelectLeadingParticle(0);
+ if(leadingID >= 0) {
+ AliRsnDaughter leadingPart = event->GetDaughter(leadingID);
+ AliVParticle *ref = leadingPart.GetRef();
+ fValue = ref->Pt();
+ }
+ else fValue = 0;
+ }
+ break;
default:
AliWarning("Invalid value type");
return kFALSE;
cuts2010->GetCutsTPC()->SetDCAToVertex2D(kFALSE); // each DCA is checked separately
cuts2010->GetCutsTPC()->SetRequireSigmaToVertex(kFALSE);
// ----> set standard quality cuts for ITS standalone tracks
- cuts2010->GetCutsITS()->SetRequireITSStandAlone(kTRUE, kTRUE);
+ cuts2010->GetCutsITS()->SetRequireITSStandAlone(kTRUE);
cuts2010->GetCutsITS()->SetRequireITSRefit(kTRUE);
cuts2010->GetCutsITS()->SetMinNClustersITS(4);
cuts2010->GetCutsITS()->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
(
Int_t nReadFiles = 0,
Int_t nSkipFiles = 0,
- const char *addTaskName = "AddAnalysisTaskRsnTest.C:AddAnalysisTaskRsnEff.C",
+ const char *addTaskName = "AddAnalysisTaskRsnTest.C",
const char *inputSource = "/home/pulvir/analysis/resonances/LHC2010-7TeV-phi/alien+plugin/sim.txt",
const char *dataLabel = "7TeV_pass2_sim_ESD",
const char *outName = "rsn-test"