y[k] = ((Float_t *)((AliTRDCalibraFit::AliTRDFitInfo *) vectora->At(k))->GetCoef())[0];
}
- if(!graph) graph = new TGraph(540,&x[0],&y[0]);
- else{
+ if(!graph){
+ graph = new TGraph(540,&x[0],&y[0]);
+ graph->SetMarkerStyle(20);
+ } else{
graph->~TGraph();
new(graph) TGraph(540,&x[0],&y[0]);
}
AliTRDrecoTask::UserExec(opt);
- Int_t nTracks = 0; // Count the number of tracks per event
+ TH1F *histo(NULL); AliTRDtrackInfo *fTrackInfo(NULL); Int_t nTracks(0); // Count the number of tracks per event
for(Int_t iti = 0; iti < fTracks->GetEntriesFast(); iti++){
if(!fTracks->UncheckedAt(iti)) continue;
- AliTRDtrackInfo *fTrackInfo = dynamic_cast<AliTRDtrackInfo *>(fTracks->UncheckedAt(iti));
+ if(!(fTrackInfo = dynamic_cast<AliTRDtrackInfo *>(fTracks->UncheckedAt(iti)))) continue;
if(!fTrackInfo->GetTrack()) continue;
nTracks++;
}
Int_t triggermask = fEventInfo->GetEventHeader()->GetTriggerMask();
TString triggername = fEventInfo->GetRunInfo()->GetFiredTriggerClasses(triggermask);
AliDebug(6, Form("Trigger cluster: %d, Trigger class: %s\n", triggermask, triggername.Data()));
- dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTrigger))->Fill(triggermask);
+ if((histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTrigger)))) histo->Fill(triggermask);
- if(nTracks)
- dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTriggerTracks))->Fill(triggermask);
+ if(nTracks){
+ if((histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTriggerTracks)))) histo->Fill(triggermask);
+ }
if(triggermask <= 20 && !fTriggerNames->FindObject(Form("%d", triggermask))){
fTriggerNames->Add(new TObjString(Form("%d", triggermask)), new TObjString(triggername));
// also set the label for both histograms
- TH1 *histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTriggerTracks));
- histo->GetXaxis()->SetBinLabel(histo->FindBin(triggermask), triggername);
- histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTrigger));
- histo->GetXaxis()->SetBinLabel(histo->FindBin(triggermask), triggername);
+ if((histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTriggerTracks))))
+ histo->GetXaxis()->SetBinLabel(histo->FindBin(triggermask), triggername);
+ if((histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTrigger))))
+ histo->GetXaxis()->SetBinLabel(histo->FindBin(triggermask), triggername);
}
}
// Do Postprocessing (for the moment set the number of Reference histograms)
//
- TH1 * h = NULL;
-
+ TH1F *h(NULL), *h1(NULL);
+
// Calculate of the trigger clusters purity
- h = dynamic_cast<TH1F *>(fContainer->FindObject("hEventsTrigger"));
- TH1F *h1 = dynamic_cast<TH1F *>(fContainer->FindObject("hEventsTriggerTracks"));
- h1->Divide(h);
- Float_t purities[20], val = 0;
- TString triggernames[20];
- Int_t nTriggerClasses = 0;
- for(Int_t ibin = 1; ibin <= h->GetNbinsX(); ibin++){
- if((val = h1->GetBinContent(ibin))){
- purities[nTriggerClasses] = val;
- triggernames[nTriggerClasses] = h1->GetXaxis()->GetBinLabel(ibin);
- nTriggerClasses++;
+ if((h = dynamic_cast<TH1F *>(fContainer->FindObject("hEventsTrigger"))) &&
+ (h1 = dynamic_cast<TH1F *>(fContainer->FindObject("hEventsTriggerTracks")))) {
+ h1->Divide(h);
+ Float_t purities[20], val = 0; memset(purities, 0, 20*sizeof(Float_t));
+ TString triggernames[20];
+ Int_t nTriggerClasses = 0;
+ for(Int_t ibin = 1; ibin <= h->GetNbinsX(); ibin++){
+ if((val = h1->GetBinContent(ibin))){
+ purities[nTriggerClasses] = val;
+ triggernames[nTriggerClasses] = h1->GetXaxis()->GetBinLabel(ibin);
+ nTriggerClasses++;
+ }
+ }
+
+ if((h = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kTriggerPurity)))){
+ TAxis *ax = h->GetXaxis();
+ for(Int_t itrg = 0; itrg < nTriggerClasses; itrg++){
+ h->Fill(itrg, purities[itrg]);
+ ax->SetBinLabel(itrg+1, triggernames[itrg].Data());
+ }
+ ax->SetRangeUser(-0.5, nTriggerClasses+.5);
+ h->GetYaxis()->SetRangeUser(0,1);
}
}
- h = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kTriggerPurity));
- TAxis *ax = h->GetXaxis();
- for(Int_t itrg = 0; itrg < nTriggerClasses; itrg++){
- h->Fill(itrg, purities[itrg]);
- ax->SetBinLabel(itrg+1, triggernames[itrg].Data());
- }
- ax->SetRangeUser(-0.5, nTriggerClasses+.5);
- h->GetYaxis()->SetRangeUser(0,1);
// track status
- h=dynamic_cast<TH1F*>(fContainer->At(kTrackStatus));
- Float_t ok = h->GetBinContent(1);
- Int_t nerr = h->GetNbinsX();
- for(Int_t ierr=nerr; ierr--;){
- h->SetBinContent(ierr+1, ok>0.?1.e2*h->GetBinContent(ierr+1)/ok:0.);
+ if((h=dynamic_cast<TH1F*>(fContainer->At(kTrackStatus)))){
+ Float_t ok = h->GetBinContent(1);
+ Int_t nerr = h->GetNbinsX();
+ for(Int_t ierr=nerr; ierr--;){
+ h->SetBinContent(ierr+1, ok>0.?1.e2*h->GetBinContent(ierr+1)/ok:0.);
+ }
+ h->SetBinContent(1, 0.);
}
- h->SetBinContent(1, 0.);
-
// tracklet status
- TObjArray *arr = dynamic_cast<TObjArray*>(fContainer->UncheckedAt(kTrackletStatus));
- for(Int_t ily = AliTRDgeometry::kNlayer; ily--;){
- h=dynamic_cast<TH1F*>(arr->At(ily));
- Float_t okB = h->GetBinContent(1);
- Int_t nerrB = h->GetNbinsX();
- for(Int_t ierr=nerrB; ierr--;){
- h->SetBinContent(ierr+1, okB>0.?1.e2*h->GetBinContent(ierr+1)/okB:0.);
+ TObjArray *arr(NULL);
+ if(( arr = dynamic_cast<TObjArray*>(fContainer->UncheckedAt(kTrackletStatus)))){
+ for(Int_t ily = AliTRDgeometry::kNlayer; ily--;){
+ if(!(h=dynamic_cast<TH1F*>(arr->At(ily)))) continue;
+ Float_t okB = h->GetBinContent(1);
+ Int_t nerrB = h->GetNbinsX();
+ for(Int_t ierr=nerrB; ierr--;){
+ h->SetBinContent(ierr+1, okB>0.?1.e2*h->GetBinContent(ierr+1)/okB:0.);
+ }
+ h->SetBinContent(1, 0.);
}
- h->SetBinContent(1, 0.);
}
-
fNRefFigures = 17;
return kTRUE;
gPad->SetLogy(0);
return kTRUE;
case kFigChi2:
- return kTRUE;
MakePlotChi2();
return kTRUE;
case kFigPH:
Float_t theta = TMath::ATan(tracklet->GetZref(1));
Float_t phi = TMath::ATan(tracklet->GetYref(1));
AliExternalTrackParam *trdPar = fkTrack->GetTrackIn();
- Float_t momentumMC = 0, momentumRec = trdPar ? trdPar->P() : track->P(); // prefer Track Low
+ Float_t momentumMC = 0, momentumRec = trdPar ? trdPar->P() : fkTrack->P(); // prefer Track Low
Int_t pdg = 0;
Int_t kinkIndex = fkESD ? fkESD->GetKinkIndex() : 0;
UShort_t tpcNCLS = fkESD ? fkESD->GetTPCncls() : 0;
return NULL;
- TH2S *h2 = (TH2S*)fContainer->At(kChi2);
+/* TH2S *h2 = (TH2S*)fContainer->At(kChi2);
TF1 f("fChi2", "[0]*pow(x, [1]-1)*exp(-0.5*x)", 0., 50.);
f.SetParLimits(1,1, 1e100);
TLegend *leg = new TLegend(.7,.7,.95,.95);
}
leg->Draw();
gPad->SetLogy();
- return h1;
+ return h1;*/
}
}
TProfile2D *hlayer = NULL;
for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++){
- hlayer = dynamic_cast<TProfile2D *>(histos->At(ily));
+ if(!(hlayer = dynamic_cast<TProfile2D *>(histos->At(ily)))) continue;
output->cd(ily + 1);
gPad->SetGrid(0,0);
hlayer->Draw("colz");
pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
- hProf2D = dynamic_cast<TProfile2D*>(fHistos->At(kTRDEtaPhiAvNtrkl));
+ if(!(hProf2D = dynamic_cast<TProfile2D*>(fHistos->At(kTRDEtaPhiAvNtrkl)))) break;
hProf2D->SetStats(kFALSE);
hProf2D->SetTitle("");
hProf2D->GetXaxis()->SetTitle("#eta");
pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);
pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
pad->SetLogz();
- h2F = dynamic_cast<TH2F*>(fHistos->At(kNClsTrackTRD));
+ if(!(h2F = dynamic_cast<TH2F*>(fHistos->At(kNClsTrackTRD)))) break;
h2F->SetStats(kFALSE);
h2F->SetTitle("");
h2F->GetXaxis()->SetTitle("p [GeV/c]");
AliTrackReference *ref(NULL);
Int_t fLabel(esdTrack->GetLabel());
Int_t fIdx(TMath::Abs(fLabel));
- if(fIdx > fStack->GetNtrack()) continue;
+ if(!fStack || fIdx > fStack->GetNtrack()) continue;
// read MC particle
if(!(mcParticle = (AliMCParticle*) fMC->GetTrack(fIdx))) {
AliWarning("No output container defined.");
return NULL;
}
- AliDebug(2, Form("TRACK[%d] species[%s][%d]\n", fkESD->GetId(), AliPID::ParticleShortName(fkMC->GetPID()), fkMC->GetPDG()));
+ AliDebug(2, Form("TRACK[%d] species[%s][%d]\n", fkESD->GetId(), fkMC->GetPID()>=0?AliPID::ParticleShortName(fkMC->GetPID()):"none", fkMC->GetPDG()));
- TH1 *h=dynamic_cast<TH1F*>(fContainer->At(kV0));
+ TH1 *h(NULL);
+ if(!(h = dynamic_cast<TH1F*>(fContainer->At(kV0)))) return NULL;
Int_t sgn(0), n(0); AliTRDv0Info *v0(NULL);
for(Int_t iv0(fV0s->GetEntriesFast()); iv0--;){
if(!(v0=(AliTRDv0Info*)fV0s->At(iv0))) continue;
h1->GetXaxis()->SetTitle("x_{drift} [cm]");
h1->GetYaxis()->SetTitle("<dQ/dl> [a.u./cm]");
}
- h = (TH1F*)h1->DrawClone(kFIRST ? "c" : "samec");
+ h1->DrawClone(kFIRST ? "c" : "samec");
kFIRST = kFALSE;
}
fContainer = Histos();
PostData(1, fContainer);
}
- fInfo = dynamic_cast<TObjArray *>(GetInputData(1));
+ if(!(fInfo = dynamic_cast<TObjArray *>(GetInputData(1)))){
+ AliError("Cluster array missing.");
+ return;
+ }
AliDebug(2, Form("Clusters[%d]", fInfo->GetEntriesFast()));
Int_t det, t, np;
}
bFIRST = kFALSE;
}
- leg->Draw();
+ if(leg) leg->Draw();
break;
}
return kTRUE;
Int_t nTrackInfos = fTracks->GetEntriesFast();
AliDebug(2, Form(" CANDIDATE TRACKS[%d]", nTrackInfos));
- AliTRDtrackV1 *trackTRD(NULL);
+ //AliTRDtrackV1 *trackTRD(NULL);
AliTRDtrackInfo *trkInf(NULL);
for(Int_t itinf = 0; itinf < nTrackInfos; itinf++){
trkInf = dynamic_cast<AliTRDtrackInfo *>(fTracks->UncheckedAt(itinf));
AliDebug(2, Form("MC(Track Reference) missing @ label[%d]", trkInf->GetLabel()));
isContamination = kTRUE;
// Debugging
- if(trackTRD && DebugLevel()>5) FillStreamTrackWOMC(trkInf);
+ if(trkInf && DebugLevel()>5) FillStreamTrackWOMC(trkInf);
}
if(isContamination){
// reject kink (we count these only once)
memcpy(tmprejected, indexReject, sizeof(Int_t) * nreject);
nreject = 0;
for(Int_t irej = 0; irej < nrej; irej++){
- trkInf = dynamic_cast<AliTRDtrackInfo *>(fTracks->At(tmprejected[irej]));
+ if(!(trkInf = dynamic_cast<AliTRDtrackInfo *>(fTracks->At(tmprejected[irej])))) continue;
Int_t idx(-1);
if((idx = IsRegistered(trkInf,indexAccept,naccept))<0){
indexReject[nreject++] = tmprejected[irej];
if(ifig >= fNRefFigures) return kFALSE;
if(!gPad) return kFALSE;
gPad->SetLogx(kTRUE);
+ TH1 *h(NULL);
if(ifig < 2){
- (dynamic_cast<TH1 *>(fContainer->At(ifig)))->Draw("e1");
+ if(!(h = (dynamic_cast<TH1 *>(fContainer->At(ifig))))) return kFALSE;
+ h->Draw("e1");
return kTRUE;
}
- TH1 *h(NULL);
TLegend *leg=new TLegend(.65, .12, .85, .3);
leg->SetHeader("Charge");
leg->SetBorderSize(1);leg->SetFillColor(kWhite);
switch(ifig){
case 2:
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram)))) return kFALSE;;
h->Draw("e1"); leg->AddEntry(h, " -", "pl");
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+1));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+1)))) return kFALSE;;
h->Draw("e1same"); leg->AddEntry(h, " +", "pl");
leg->Draw();
break;
case 3:
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+2));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+2)))) return kFALSE;;
h->Draw("e1"); leg->AddEntry(h, " -", "pl");
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+3));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+3)))) return kFALSE;;
h->Draw("e1same"); leg->AddEntry(h, " +", "pl");
leg->Draw();
break;
case 4:
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+4));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+4)))) return kFALSE;;
h->Draw("e1"); leg->AddEntry(h, " -", "pl");
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+5));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+5)))) return kFALSE;;
h->Draw("e1same"); leg->AddEntry(h, " +", "pl");
leg->Draw();
break;
case 5:
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+6));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+6)))) return kFALSE;;
h->Draw("e1"); leg->AddEntry(h, " -", "pl");
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+7));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+7)))) return kFALSE;;
h->Draw("e1same"); leg->AddEntry(h, " +", "pl");
leg->Draw();
break;
case 6:
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+8));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+8)))) return kFALSE;;
h->Draw("e1"); leg->AddEntry(h, " -", "pl");
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+9));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+9)))) return kFALSE;;
h->Draw("e1same"); leg->AddEntry(h, " +", "pl");
leg->Draw();
break;
case 7:
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+10));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+10)))) return kFALSE;;
h->Draw("e1"); leg->AddEntry(h, " -", "pl");
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+11));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+11)))) return kFALSE;;
h->Draw("e1same"); leg->AddEntry(h, " +", "pl");
leg->Draw();
break;
case 8:
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+12));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+12)))) return kFALSE;;
h->Draw("e1"); leg->AddEntry(h, " -", "pl");
- h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+13));
+ if(!(h=dynamic_cast<TH1 *>(fContainer->At(kEfficiencySpeciesHistogram+13)))) return kFALSE;;
h->Draw("e1same"); leg->AddEntry(h, " +", "pl");
leg->Draw();
break;
Int_t trkpdg(-1); // particle PDG code
AliTRDtrackInfo *trkInf(NULL);
for(Int_t itk = 0; itk < nTracks; itk++){
- trkInf = dynamic_cast<AliTRDtrackInfo *>(fTracks->At(indices[itk]));
+ if(!(trkInf = dynamic_cast<AliTRDtrackInfo *>(fTracks->At(indices[itk])))) continue;
if(trkInf->GetNTrackRefs()){
// use Monte-Carlo Information for Momentum and PID
trkmom = trkInf->GetTrackRef(0)->P();
trkmom = trkInf->GetTrack()->P();
}
+ TProfile *hp(NULL);
const Char_t *cmode(NULL);
switch(mode){
case kAccept:
- (dynamic_cast<TProfile *>(fContainer->At(kEfficiencyHistogram)))->Fill(trkmom, 1);
- (dynamic_cast<TProfile *>(fContainer->At(kContaminationHistogram)))->Fill(trkmom, 0);
+ if(!(hp = (dynamic_cast<TProfile *>(fContainer->At(kEfficiencyHistogram))))) continue;
+ hp->Fill(trkmom, 1);
+ if(!(hp = ((dynamic_cast<TProfile *>(fContainer->At(kContaminationHistogram)))))) continue;
+ hp->Fill(trkmom, 0);
cmode="ACCEPT";
break;
case kMiss:
- (dynamic_cast<TProfile *>(fContainer->At(kEfficiencyHistogram)))->Fill(trkmom, 0);
- (dynamic_cast<TProfile *>(fContainer->At(kContaminationHistogram)))->Fill(trkmom, 0);
+ if(!(hp = ((dynamic_cast<TProfile *>(fContainer->At(kEfficiencyHistogram)))))) continue;
+ hp->Fill(trkmom, 0);
+ if(!(hp = ((dynamic_cast<TProfile *>(fContainer->At(kContaminationHistogram)))))) continue;
+ hp->Fill(trkmom, 0);
cmode="MISS";
break;
case kFake:
- (dynamic_cast<TProfile *>(fContainer->At(kContaminationHistogram)))->Fill(trkmom, 1);
+ if(!(hp = ((dynamic_cast<TProfile *>(fContainer->At(kContaminationHistogram)))))) continue;
+ hp->Fill(trkmom, 1);
cmode="FAKE";
break;
}
Int_t sign = dbPDG->GetParticle(trkpdg)->Charge() > 0. ? 1 : 0;
//printf("[%d]%s pdg[%d] sign[%d]\n", idxSpec, AliPID::ParticleName(idxSpec), trkpdg, sign);
if(idxSpec < 0) idxSpec = AliPID::kSPECIES;
- (dynamic_cast<TProfile *>(fContainer->At(kEfficiencySpeciesHistogram + idxSpec*2+sign)))->Fill(trkmom, mode==kAccept?1:0);
+ if(!(hp = (dynamic_cast<TProfile *>(fContainer->At(kEfficiencySpeciesHistogram + idxSpec*2+sign))))) continue;
+ hp->Fill(trkmom, mode==kAccept?1:0);
}
}
// Checks if track is registered in a given mode
//
+ AliTRDtrackInfo *ti(NULL);
Int_t label(trkInf->GetLabel());
for(Int_t il(nTracks); il--;){
- if((dynamic_cast<AliTRDtrackInfo *>(fTracks->At(indices[il])))->GetLabel() == label) return il;
+ if(!(ti = dynamic_cast<AliTRDtrackInfo *>(fTracks->At(indices[il])))) continue;
+ if(ti->GetLabel() == label) return il;
}
return -1;
}
ocdb->SetDefaultStorage(fOCDB.Data());
ocdb->SetRun(fESDev->GetRunNumber());
// create geo manager
- AliCDBEntry* obj = ocdb->Get(AliCDBPath("GRP", "Geometry", "Data"));
- AliGeomManager::SetGeometry((TGeoManager*)obj->GetObject());
- AliGeomManager::GetNalignable("TRD");
- AliGeomManager::ApplyAlignObjsFromCDB("TRD");
+ AliCDBEntry* obj(NULL);
+ if(!(obj = ocdb->Get(AliCDBPath("GRP", "Geometry", "Data")))){
+ AliError("GEOMETRY failed initialization.");
+ } else {
+ AliGeomManager::SetGeometry((TGeoManager*)obj->GetObject());
+ AliGeomManager::GetNalignable("TRD");
+ AliGeomManager::ApplyAlignObjsFromCDB("TRD");
+ }
fgGeo = new AliTRDgeometry;
//init magnetic field
if(!TGeoGlobalMagField::Instance()->IsLocked() &&
!fESDev->InitMagneticField()){
- AliWarning("Magnetic field failed initialization.");
+ AliError("MAGNETIC FIELD failed initialization.");
}
// set no of time bins
AliInfo(Form("Initializing TRD reco params for EventSpecie[%d]...",
fESDev->GetEventSpecie()));
fgReconstructor = new AliTRDReconstructor();
- obj = ocdb->Get(AliCDBPath("TRD", "Calib", "RecoParam"));
- obj->PrintMetaData();
- TObjArray *recos((TObjArray*)obj->GetObject());
- for(Int_t ireco(0); ireco<recos->GetEntriesFast(); ireco++){
- AliTRDrecoParam *reco((AliTRDrecoParam*)recos->At(ireco));
- Int_t es(reco->GetEventSpecie());
- if(!(es&fESDev->GetEventSpecie())) continue;
- fgReconstructor->SetRecoParam(reco);
- TString s;
- if(es&AliRecoParam::kLowMult) s="LowMult";
- else if(es&AliRecoParam::kHighMult) s="HighMult";
- else if(es&AliRecoParam::kCosmic) s="Cosmic";
- else if(es&AliRecoParam::kCalib) s="Calib";
- else s="Unknown";
- AliInfo(Form("Using reco params for %s", s.Data()));
- break;
+ if(!(obj = ocdb->Get(AliCDBPath("TRD", "Calib", "RecoParam")))){
+ AliError("RECO PARAM failed initialization.");
+ fgReconstructor->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
+ } else {
+ obj->PrintMetaData();
+ TObjArray *recos((TObjArray*)obj->GetObject());
+ for(Int_t ireco(0); ireco<recos->GetEntriesFast(); ireco++){
+ AliTRDrecoParam *reco((AliTRDrecoParam*)recos->At(ireco));
+ Int_t es(reco->GetEventSpecie());
+ if(!(es&fESDev->GetEventSpecie())) continue;
+ fgReconstructor->SetRecoParam(reco);
+ TString s;
+ if(es&AliRecoParam::kLowMult) s="LowMult";
+ else if(es&AliRecoParam::kHighMult) s="HighMult";
+ else if(es&AliRecoParam::kCosmic) s="Cosmic";
+ else if(es&AliRecoParam::kCalib) s="Calib";
+ else s="Unknown";
+ AliInfo(Form("Using reco params for %s", s.Data()));
+ break;
+ }
}
SetInitOCDB();
}
AliDebug(1, Form("Entries: Ev[%d] Tracks[%d] V0[%d] PID[%d]", ev, fTracks->GetEntriesFast(), fV0s->GetEntriesFast(), fInfo->GetEntriesFast()));
AliTRDtrackInfo *track = NULL;
- AliTRDtrackV1 *trackTRD = NULL;
+ //AliTRDtrackV1 *trackTRD = NULL;
AliTrackReference *ref = NULL;
const AliTRDtrackInfo::AliESDinfo *infoESD = NULL;
for(Int_t itrk=0; itrk<fTracks->GetEntriesFast(); itrk++){
track = (AliTRDtrackInfo*)fTracks->UncheckedAt(itrk);
if(!track->HasESDtrack()) continue;
- trackTRD = track->GetTrack();
+ //trackTRD = track->GetTrack();
infoESD = track->GetESDinfo();
Double32_t *infoPID = infoESD->GetSliceIter();
Int_t n = infoESD->GetNSlices() - AliTRDgeometry::kNlayer;
// fill the pid information
SetRefPID(fRefPID, track, infoESD, fPID);
// get particle type
- Int_t idx(TMath::LocMax(AliPID::kSPECIES, fPID));
+ Int_t idx(TMath::Max(Long64_t(0), TMath::LocMax(AliPID::kSPECIES, fPID)));
if(fPID[idx]<1.e-5) continue;
// prepare PID data array
// estimate bucket statistics
Int_t idx(AliTRDCalPIDLQ::GetModelID(ip,is)),
nb(kMinBuckets), // number of buckets
- ns((Int_t)(((Float_t)(ndata[idx]))/nb)); //statistics/bucket
+ ns((Int_t)(((Float_t)(ndata[idx]))/nb)); //statistics/bucket
AliDebug(2, Form("pBin[%d] sBin[%d] n[%d] ns[%d] nb[%d]", ip, is, ndata[idx], ns, nb));
if(ns<Int_t(kMinStat)){
}
}
- pdf=dynamic_cast<TKDPDF*>(fPDF->At(idx));
+ if(!(pdf=dynamic_cast<TKDPDF*>(fPDF->At(idx)))){
+ AliWarning(Form("Missing pdf for model id[%d]", idx));
+ continue;
+ }
TH1 *h1 = (TH1D*)((TObjArray*)fContainer->At(ip))->At(is);
ax = h1->GetXaxis();
h1->Clear();
else{
for(Int_t iMomBin = 0; iMomBin < AliTRDCalPID::kNMom; iMomBin++){
if(fTrain[iMomBin] -> GetN() < fMinTrain){
- AliError(Form("Warning in AliTRDpidRefMakerNN::PostProcess : Not enough events for training available for momentum bin [%d]! Please check Data sample!", iMomBin));
- continue;
+ AliError(Form("Warning in AliTRDpidRefMakerNN::PostProcess : Not enough events for training available for momentum bin [%d]! Please check Data sample!", iMomBin));
+ continue;
}
- MakeRefs(fTrainMomBin);
+ MakeRefs(iMomBin);
MonitorTraining(iMomBin);
}
}
// Recursively merge files named "mark" from list in "files" in groups of "nBatch" files.
// parameter "level" is used to index recurent calls of this function.
- Char_t lMERGE[8]; sprintf(lMERGE, "%04d.lst", (Int_t)gRandom->Uniform(9999.));
- Char_t lPURGE[8]; sprintf(lPURGE, "%04d.lst", (Int_t)gRandom->Uniform(9999.));
+ Char_t lMERGE[8]; snprintf(lMERGE, 8, "%04d.lst", (Int_t)gRandom->Uniform(9999.));
+ Char_t lPURGE[8]; snprintf(lPURGE, 8, "%04d.lst", (Int_t)gRandom->Uniform(9999.));
// purge file list
std::string filename;
continue;
}
if(kSVN){ // download SVN info for trending
- std::string base=filename.substr(0, filename.find_last_of('/'));
- if(gSystem->Exec(Form("if [ ! -f svnInfo.log ]; then cp -v %s/svnInfo.log %s; fi", base.c_str(), gSystem->ExpandPathName("$PWD"))) == 0) kSVN=kFALSE;
+ if(gSystem->Exec(Form("if [ ! -f svnInfo.log ]; then cp -v %s/svnInfo.log %s; fi", Basename(filename.c_str()), gSystem->ExpandPathName("$PWD"))) == 0) kSVN=kFALSE;
}
Info("MergeBatch()", filename.c_str());
if(!fFM.AddFile(filename.c_str())) return NULL;
,fkESD(NULL)
,fPlotFuncList(NULL)
{
-// Default constructor
+// Default constructor
+ snprintf(fNameId, 10, "no name");
}
//_______________________________________________________
// Constructor for all derived performance tasks
SetTitle(title);
+ snprintf(fNameId, 10, "no name");
DefineInput (1, TObjArray::Class()); // track list
DefineOutput(1, TObjArray::Class()); // histogram list
}
virtual Bool_t PutTrendValue(const Char_t *name, Double_t val);
virtual void SetFriends(Bool_t fr = kTRUE) {SetBit(kFriends, fr);}
virtual void SetMCdata(Bool_t mc = kTRUE) {SetBit(kMCdata, mc);}
- virtual void SetNameId(const Char_t *nid) {sprintf(fNameId, "%s", nid);}
+ virtual void SetNameId(const Char_t *nid) {snprintf(fNameId, 10, "%s", nid);}
virtual void SetPostProcess(Bool_t pp = kTRUE) {SetBit(kPostProcess, pp);}
virtual void Terminate(Option_t *);
p=cOut->cd(3);
p->SetRightMargin(0.06);p->SetTopMargin(0.06);
xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
- GetGraphArray(xy, kCluster, 1, 1);
+ if(!GetGraphArray(xy, kCluster, 1, 1)) return;
p=cOut->cd(4);
p->SetRightMargin(0.16);p->SetTopMargin(0.06);
p=cOut->cd(6);
p->SetRightMargin(0.06);p->SetTopMargin(0.06);
xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
- GetGraphArray(xy, kTrack, 1, 1);
+ if(!GetGraphArray(xy, kTrack, 1, 1)) return;
cOut->SaveAs(Form("%s.gif", cOut->GetName()));
TH1 *h(NULL); char hname[100], htitle[300];
// tracklet resolution/pull in y direction
- sprintf(hname, "%s_%s_Y", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_Y", GetNameId(), name);
sprintf(htitle, "Y res for \"%s\" @ %s;tg(#phi);#Delta y [cm];%s", GetNameId(), name, fgkResYsegmName[fSegmentLevel]);
if(!(h = (TH3S*)gROOT->FindObject(hname))){
Int_t nybins=fgkNresYsegm[fSegmentLevel];
nybins, -0.5, nybins-0.5);// segment
} else h->Reset();
arr->AddAt(h, 0);
- sprintf(hname, "%s_%s_YZpull", GetNameId(), name);
- sprintf(htitle, "YZ pull for \"%s\" @ %s;%s;#Delta y / #sigma_{y};#Delta z / #sigma_{z}", GetNameId(), name, fgkResYsegmName[fSegmentLevel]);
+ snprintf(hname, 100, "%s_%s_YZpull", GetNameId(), name);
+ snprintf(htitle, 300, "YZ pull for \"%s\" @ %s;%s;#Delta y / #sigma_{y};#Delta z / #sigma_{z}", GetNameId(), name, fgkResYsegmName[fSegmentLevel]);
if(!(h = (TH3S*)gROOT->FindObject(hname))){
h = new TH3S(hname, htitle, fgkNresYsegm[fSegmentLevel], -0.5, fgkNresYsegm[fSegmentLevel]-0.5, 100, -4.5, 4.5, 100, -4.5, 4.5);
} else h->Reset();
TH1 *h(NULL); char hname[100], htitle[300];
// tracklet resolution/pull in z direction
- sprintf(hname, "%s_%s_Z", GetNameId(), name);
- sprintf(htitle, "Z res for \"%s\" @ %s;tg(#theta);#Delta z [cm];row cross", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_Z", GetNameId(), name);
+ snprintf(htitle, 300, "Z res for \"%s\" @ %s;tg(#theta);#Delta z [cm];row cross", GetNameId(), name);
if(!(h = (TH3S*)gROOT->FindObject(hname))){
h = new TH3S(hname, htitle, 50, -1., 1., 100, -1.5, 1.5, 2, -0.5, 1.5);
} else h->Reset();
arr->AddAt(h, 2);
- sprintf(hname, "%s_%s_Zpull", GetNameId(), name);
- sprintf(htitle, "Z pull for \"%s\" @ %s;tg(#theta);#Delta z / #sigma_{z};row cross", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_Zpull", GetNameId(), name);
+ snprintf(htitle, 300, "Z pull for \"%s\" @ %s;tg(#theta);#Delta z / #sigma_{z};row cross", GetNameId(), name);
if(!(h = (TH3S*)gROOT->FindObject(hname))){
h = new TH3S(hname, htitle, 50, -1., 1., 100, -5.5, 5.5, 2, -0.5, 1.5);
h->GetZaxis()->SetBinLabel(1, "no RC");
arr->AddAt(h, 3);
// tracklet to track phi resolution
- sprintf(hname, "%s_%s_PHI", GetNameId(), name);
- sprintf(htitle, "#Phi res for \"%s\" @ %s;tg(#phi);#Delta #phi [rad];entries", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_PHI", GetNameId(), name);
+ snprintf(htitle, 300, "#Phi res for \"%s\" @ %s;tg(#phi);#Delta #phi [rad];entries", GetNameId(), name);
if(!(h = (TH2I*)gROOT->FindObject(hname))){
h = new TH2I(hname, htitle, 21, -.33, .33, 100, -.5, .5);
} else h->Reset();
TAxis *ax(NULL);
// snp pulls
- sprintf(hname, "%s_%s_SNPpull", GetNameId(), name);
- sprintf(htitle, "SNP pull for \"%s\" @ %s;tg(#phi);#Delta snp / #sigma_{snp};entries", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_SNPpull", GetNameId(), name);
+ snprintf(htitle, 300, "SNP pull for \"%s\" @ %s;tg(#phi);#Delta snp / #sigma_{snp};entries", GetNameId(), name);
if(!(h = (TH2I*)gROOT->FindObject(hname))){
h = new TH2I(hname, htitle, 60, -.3, .3, 100, -4.5, 4.5);
} else h->Reset();
arr->AddAt(h, 5);
// theta resolution
- sprintf(hname, "%s_%s_THT", GetNameId(), name);
- sprintf(htitle, "#Theta res for \"%s\" @ %s;tg(#theta);#Delta #theta [rad];entries", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_THT", GetNameId(), name);
+ snprintf(htitle, 300, "#Theta res for \"%s\" @ %s;tg(#theta);#Delta #theta [rad];entries", GetNameId(), name);
if(!(h = (TH2I*)gROOT->FindObject(hname))){
h = new TH2I(hname, htitle, 100, -1., 1., 100, -5e-3, 5e-3);
} else h->Reset();
arr->AddAt(h, 6);
// tgl pulls
- sprintf(hname, "%s_%s_TGLpull", GetNameId(), name);
- sprintf(htitle, "TGL pull for \"%s\" @ %s;tg(#theta);#Delta tgl / #sigma_{tgl};entries", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_TGLpull", GetNameId(), name);
+ snprintf(htitle, 300, "TGL pull for \"%s\" @ %s;tg(#theta);#Delta tgl / #sigma_{tgl};entries", GetNameId(), name);
if(!(h = (TH2I*)gROOT->FindObject(hname))){
h = new TH2I(hname, htitle, 100, -1., 1., 100, -4.5, 4.5);
} else h->Reset();
for(Int_t i=0; i<kNdpt+1; i++,lDPt+=2.e-3) binsDPt[i]=lDPt;
// Pt resolution
- sprintf(hname, "%s_%s_Pt", GetNameId(), name);
- sprintf(htitle, "P_{t} res for \"%s\" @ %s;p_{t} [GeV/c];#Delta p_{t}/p_{t}^{MC};SPECIES", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_Pt", GetNameId(), name);
+ snprintf(htitle, 300, "#splitline{P_{t} res for}{\"%s\" @ %s};p_{t} [GeV/c];#Delta p_{t}/p_{t}^{MC};SPECIES", GetNameId(), name);
if(!(h = (TH3S*)gROOT->FindObject(hname))){
h = new TH3S(hname, htitle,
kNpt, binsPt, kNdpt, binsDPt, kNspc, binsSpc);
} else h->Reset();
arr->AddAt(h, 8);
// 1/Pt pulls
- sprintf(hname, "%s_%s_1Pt", GetNameId(), name);
- sprintf(htitle, "1/P_{t} pull for \"%s\" @ %s;1/p_{t}^{MC} [c/GeV];#Delta(1/p_{t})/#sigma(1/p_{t});SPECIES", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_1Pt", GetNameId(), name);
+ snprintf(htitle, 300, "#splitline{1/P_{t} pull for}{\"%s\" @ %s};1/p_{t}^{MC} [c/GeV];#Delta(1/p_{t})/#sigma(1/p_{t});SPECIES", GetNameId(), name);
if(!(h = (TH3S*)gROOT->FindObject(hname))){
h = new TH3S(hname, htitle,
kNpt, 0., 2., 100, -4., 4., kNspc, -5.5, 5.5);
} else h->Reset();
arr->AddAt(h, 9);
// P resolution
- sprintf(hname, "%s_%s_P", GetNameId(), name);
- sprintf(htitle, "P res for \"%s\" @ %s;p [GeV/c];#Delta p/p^{MC};SPECIES", GetNameId(), name);
+ snprintf(hname, 100, "%s_%s_P", GetNameId(), name);
+ snprintf(htitle, 300, "P res for \"%s\" @ %s;p [GeV/c];#Delta p/p^{MC};SPECIES", GetNameId(), name);
if(!(h = (TH3S*)gROOT->FindObject(hname))){
h = new TH3S(hname, htitle,
kNpt, binsPt, kNdpt, binsDPt, kNspc, binsSpc);
// Do the processing
//
- Char_t pn[10]; sprintf(pn, "p%03d", fIdxPlot);
+ Char_t pn[10]; snprintf(pn, 10, "p%03d", fIdxPlot);
Int_t n = 0;
if((n=g[0]->GetN())) for(;n--;) g[0]->RemovePoint(n);
if((n=g[1]->GetN())) for(;n--;) g[1]->RemovePoint(n);
if(!(gm = (TGraphAsymmErrors*)((TObjArray*)fGraphM->At(plot))->At(0))) return kFALSE;
if(!(gs = (TGraphErrors*)((TObjArray*)fGraphS->At(plot)))) return kFALSE;
- Float_t x, r, mpv, xM, xm;
+ Float_t x(0.), r(0.), mpv(0.), xM(0.), xm(0.);
TAxis *ay = h3->GetYaxis();
for(Int_t iy=1; iy<=h3->GetNbinsY(); iy++){
ay->SetRange(iy, iy);
{
// Constructor. Reset all fields.
memset(fLimits, 0, 2*(kNlevels+1)*sizeof(Double_t));
- for(Int_t ilevel(kNlevels); ilevel--; ) sprintf(fAlarmMessage[ilevel], " ");
+ for(Int_t ilevel(kNlevels); ilevel--; ) snprintf(fAlarmMessage[ilevel], 1024, " ");
}
//____________________________________________
} else SetName(n);
memset(fLimits, 0, 2*(kNlevels+1)*sizeof(Double_t));
- for(Int_t ilevel(kNlevels); ilevel--; ) sprintf(fAlarmMessage[ilevel], " ");
+ for(Int_t ilevel(kNlevels); ilevel--; ) snprintf(fAlarmMessage[ilevel], 1024, " ");
}
//____________________________________________
const char* AliTRDtrendValue::GetResponsible(Char_t *n, Char_t *mail) const
{
// Get responsible with name and mail
- if(n) sprintf(n, "%s", fResponsible.fNameR);
- if(mail) sprintf(mail, "%s", fResponsible.fMail);
+ if(n) snprintf(n, 100, "%s", fResponsible.fNameR);
+ if(mail) snprintf(mail, 200, "%s", fResponsible.fMail);
return Form("%s <%s>", fResponsible.fNameR, fResponsible.fMail);
}
{
// Get noticible person "in" with name and mail
if(in<0||in>=fNnotifiable) return NULL;
- if(n) sprintf(n, "%s", fNotifiable[in].fNameR);
- if(mail) sprintf(mail, "%s", fNotifiable[in].fMail);
+ if(n) snprintf(n, 100, "%s", fNotifiable[in].fNameR);
+ if(mail) snprintf(mail, 200, "%s", fNotifiable[in].fMail);
return Form("%s <%s>", fNotifiable[in].fNameR, fNotifiable[in].fMail);
}
AliWarning(Form("Could not add %s for notification. Only %d persons can be registered for notification.", name, kNnotifiable));
return;
}
- sprintf(fNotifiable[fNnotifiable].fNameR, "%s", name);
- sprintf(fNotifiable[fNnotifiable].fMail, "%s", mail);
+ snprintf(fNotifiable[fNnotifiable].fNameR, 100, "%s", name);
+ snprintf(fNotifiable[fNnotifiable].fMail, 200, "%s", mail);
fNnotifiable++;
}
void AliTRDtrendValue::SetResponsible(const Char_t *name, const Char_t *mail)
{
// set responsible person for trend
- sprintf(fResponsible.fNameR, "%s", name);
- sprintf(fResponsible.fMail, "%s", mail);
+ snprintf(fResponsible.fNameR, 100, "%s", name);
+ snprintf(fResponsible.fMail, 200, "%s", mail);
}
//____________________________________________
AliTRDtrendValue::AliTRDtrendValueResponsible::AliTRDtrendValueResponsible(Char_t *n, Char_t *m)
{
// define person with mail and mail
- if(n) sprintf(fNameR, "%s", n); else sprintf(fNameR, " ");
- if(m) sprintf(fMail, "%s", m); else sprintf(fMail, " ");
+ if(n) snprintf(fNameR, 100, "%s", n); else snprintf(fNameR, 100, " ");
+ if(m) snprintf(fMail, 200, "%s", m); else snprintf(fMail, 200, " ");
}
if(!trd){
AliWarningGeneral("AliTRDtrendingManager", "TRD OCDB manager not initialized. No trending DB available.");
} else {
- const TObjArray *trendMap(NULL/*trd->GetTrendMap()*/);
+/* const TObjArray *trendMap(trd->GetTrendMap());
if(!trendMap){
AliWarningGeneral("AliTRDtrendingManager", "No TRD trending DB available for TRD.");
- } else fgInstance->fEntries=(TObjArray*)trendMap->Clone();
+ } else fgInstance->fEntries=(TObjArray*)trendMap->Clone();*/
}
}
memset(fArmenteros, 0, kNDecays*sizeof(Bool_t));
memset(fTPCdEdx, 0, kNDaughters*sizeof(Float_t));
memset(fChi2ndf, 0, kNDecays*sizeof(Double_t));
-
+ memset(fDownOpenAngle, 0, kNDecays*sizeof(Float_t));
+ memset(fDownPsiPair, 0, kNDecays*sizeof(Float_t));
/////////////////////////////////////////////////////////////////////////////
//Set Cut values: First specify decay in brackets, then the actual cut value!
/////////////////////////////////////////////////////////////////////////////