gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
AliXRDPROOFtoolkit tool;
- TChain * chainCosmic = tool.MakeChainRandom("cosmic.txt","Track0",0,10000);
-
-
+ TChain * chainCosmic = tool.MakeChainRandom("cosmic.txt","Track0",0,10000);
+ TChain * chainBudget = tool.MakeChainRandom("cosmic.txt","material",0,1000);
+ TCut cutptV="abs(1/pt0V-1/pt1V)<0.1";
+ TCut cutptI="abs(1/pt0In-1/pt1In)<0.5";
+ TCut cutncl="nclmin>120";
+ TCut cutDz="abs(p0.fP[1])<50";
+ TCut cutDr="abs(p0.fP[0])<50";
+ //
+ chainBudget->Draw(">>listB",cutptV+cutptI+cutncl+cutDr+cutDz,"entryList");
+ TEntryList *elistB = (TEntryList*)gDirectory->Get("listB");
+ chainBudget->SetEntryList(elistB);
+
+ chainBudget->SetAlias("dptrel","(pt0V-pt1V)/((pt0V+pt1V)*0.5)");
+ chainBudget->SetAlias("dptInrel","(pt0In-pt1In)/((pt0In+pt1In)*0.5)");
+ chainBudget->SetAlias("ptcorr","(pt0In-pt0V)/(pt0V)+(pt1V-pt1In)/(pt1In)");
*/
#include "TFile.h"
#include "TF1.h"
#include "THnSparse.h"
+#include "TDatabasePDG.h"
#include "AliTPCclusterMI.h"
#include "AliTPCseed.h"
#include "AliTPCcalibCosmic.h"
#include "TTreeStream.h"
#include "AliTPCTracklet.h"
-#include "AliESDcosmic.h"
+//#include "AliESDcosmic.h"
ClassImp(AliTPCcalibCosmic)
xminTrack[5] =-1; xmaxTrack[5]=1; //
axisName[5] ="tan(#theta)";
//
- binsTrack[6] =10;
- xminTrack[6] =0; xmaxTrack[6]=2; //
+ binsTrack[6] =40;
+ xminTrack[6] =-2; xmaxTrack[6]=2; //
axisName[6] ="1/pt (1/GeV)";
//
binsTrack[7] =40;
xminTrack[7] =0.2; xmaxTrack[7]=50; //
axisName[7] ="pt (GeV)";
//
- binsTrack[8] =32;
+ binsTrack[8] =18;
xminTrack[8] =0; xmaxTrack[8]=TMath::Pi(); //
axisName[8] ="alpha";
//
Printf("ERROR: ESD not available");
return;
}
- AliESDfriend *ESDfriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
- if (!ESDfriend) {
- Printf("ERROR: ESDfriend not available");
+ AliESDfriend *esdFriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
+ if (!esdFriend) {
+ Printf("ERROR: esdFriend not available");
return;
}
}
-void AliTPCcalibCosmic::FillHistoPerformance(AliExternalTrackParam *par0, AliExternalTrackParam *par1, AliExternalTrackParam *inner0, AliExternalTrackParam *inner1, AliTPCseed *seed0, AliTPCseed *seed1){
- //
+void AliTPCcalibCosmic::FillHistoPerformance(const AliExternalTrackParam *par0, const AliExternalTrackParam *par1, const AliExternalTrackParam *inner0, const AliExternalTrackParam */*inner1*/, AliTPCseed *seed0, AliTPCseed *seed1, const AliExternalTrackParam *param0Combined ){
//
+ // par0,par1 - parameter of tracks at DCA 0
+ // inner0,inner1 - parameter of tracks at the TPC entrance
+ // seed0, seed1 - detailed track information
+ // param0Combined - Use combined track parameters for binning
//
Int_t kMinCldEdx =20;
Int_t ncl0 = seed0->GetNumberOfClusters();
// bin parameters
x[1] = TMath::Min(ncl0,ncl1);
x[2] = (radius0+radius1)*0.5;
- x[3] = (inner0->GetZ()+inner1->GetZ())*0.5;
- x[4] = (inner0->GetSnp()-inner1->GetSnp())*0.5;
- x[5] = (inner0->GetTgl()-inner1->GetTgl())*0.5;
- x[6] = (1/par0->Pt()+1/par1->Pt())*0.5;
- x[7] = (par0->Pt()+par1->Pt())*0.5;
+ x[3] = param0Combined->GetZ();
+ x[4] = inner0->GetSnp();
+ x[5] = param0Combined->GetTgl();
+ x[6] = param0Combined->GetSigned1Pt();
+ x[7] = param0Combined->Pt();
x[8] = alpha;
// deltas
Double_t delta[6];
}
-
+void AliTPCcalibCosmic::MaterialBudgetDump(AliExternalTrackParam *const par0, AliExternalTrackParam *const par1, const AliExternalTrackParam *inner0, const AliExternalTrackParam *inner1, AliTPCseed *const seed0, AliTPCseed *const seed1, AliExternalTrackParam *const param0Combined, AliExternalTrackParam *const param1Combined){
+ //
+ // matrial budget AOD dump
+ //
+ // par0,par1 - parameter of tracks at DCA 0
+ // inner0,inner1 - parameter of tracks at the TPC entrance
+ // seed0, seed1 - detailed track information
+ // param0Combined - Use combined track parameters for binning
+ // param1Combined -
+ Double_t p0In = inner0->GetP();
+ Double_t p1In = inner1->GetP();
+ Double_t p0V = par0->GetP();
+ Double_t p1V = par1->GetP();
+ //
+ Double_t pt0In = inner0->Pt();
+ Double_t pt1In = inner1->Pt();
+ Double_t pt0V = par0->Pt();
+ Double_t pt1V = par1->Pt();
+ Int_t ncl0 = seed0->GetNumberOfClusters();
+ Int_t ncl1 = seed1->GetNumberOfClusters();
+ Int_t nclmin=TMath::Min(ncl0,ncl1);
+ Double_t sign = (param0Combined->GetSigned1Pt()>0) ? 1:-1.;
+ //
+ TTreeSRedirector * pcstream = GetDebugStreamer();
+ if (pcstream){
+ (*pcstream)<<"material"<<
+ "run="<<fRun<< // run number
+ "event="<<fEvent<< // event number
+ "time="<<fTime<< // time stamp of event
+ "trigger="<<fTrigger<< // trigger
+ "triggerClass="<<&fTriggerClass<< // trigger
+ "mag="<<fMagF<< // magnetic field
+ "sign="<<sign<< // sign of the track
+ //
+ "ncl0="<<ncl0<<
+ "ncl1="<<ncl1<<
+ "nclmin="<<nclmin<<
+ //
+ "p0In="<<p0In<<
+ "p1In="<<p1In<<
+ "p0V="<<p0V<<
+ "p1V="<<p1V<<
+ "pt0In="<<pt0In<<
+ "pt1In="<<pt1In<<
+ "pt0V="<<pt0V<<
+ "pt1V="<<pt1V<<
+ "p0.="<<par0<<
+ "p1.="<<par1<<
+ "up0.="<<param0Combined<<
+ "up1.="<<param1Combined<<
+ "\n";
+ }
+
+}
void AliTPCcalibCosmic::Analyze() {
// Track1 is choosen in lower TPC part
//
if (GetDebugLevel()>20) printf("Hallo world: Im here\n");
- AliESDfriend *ESDfriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
+ AliESDfriend *esdFriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
Int_t ntracks=event->GetNumberOfTracks();
TObjArray tpcSeeds(ntracks);
if (ntracks==0) return;
if (ntracks>4 && TMath::Abs(trackIn->GetTgl())<0.0015) continue; // filter laser
- AliESDfriendTrack *friendTrack = ESDfriend->GetTrack(i);
+ AliESDfriendTrack *friendTrack = esdFriend->GetTrack(i);
TObject *calibObject;
AliTPCseed *seed = 0;
for (Int_t l=0;(calibObject=friendTrack->GetCalibObject(l));++l) {
//
if (meanP > 0.4 && meanP < 0.45) fDeDxMIP->Fill(seed->CookdEdxNorm(0.0,0.45,0,0,159));
//
- if (GetDebugLevel()>0&&meanP>0.2&&seed->CookdEdxNorm(0.0,0.45,0,0,159)>300) {
- TFile *curfile = AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile();
- if (curfile) printf(">>> p+ in file: %s \t event: %i \t Number of ESD tracks: %i \n", curfile->GetName(), (int)event->GetEventNumberInFile(), (int)ntracks);
- if (track->GetOuterParam()->GetAlpha()<0) cout << " Polartiy: " << track->GetSign() << endl;
- }
+ // if (GetDebugLevel()>0&&meanP>0.2&&seed->CookdEdxNorm(0.0,0.45,0,0,159)>300) {
+// //TFile *curfile = AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile();
+// //if (curfile) printf(">>> p+ in file: %s \t event: %i \t Number of ESD tracks: %i \n", curfile->GetName(), (int)event->GetEventNumberInFile(), (int)ntracks);
+// // if (track->GetOuterParam()->GetAlpha()<0) cout << " Polartiy: " << track->GetSign() << endl;
+// }
}
//
// Propagate using Magnetic field and correct fo material budget
//
- AliTracker::PropagateTrackTo(¶m0,dmax+1,0.0005,3,kTRUE);
- AliTracker::PropagateTrackTo(¶m1,dmax+1,0.0005,3,kTRUE);
+ Double_t sign0=-1;
+ Double_t sign1=1;
+ Double_t maxsnp=0.90;
+ AliTracker::PropagateTrackToBxByBz(¶m0,dmax+1,TDatabasePDG::Instance()->GetParticle("e-")->Mass(),3,kTRUE,maxsnp,sign0);
+ AliTracker::PropagateTrackToBxByBz(¶m1,dmax+1,TDatabasePDG::Instance()->GetParticle("e-")->Mass(),3,kTRUE,maxsnp,sign1);
//
// Propagate rest to the 0,0 DCA - z should be ignored
//
//
//
//
- FillHistoPerformance(¶m0, ¶m1, ip0, ip1, seed0, seed1);
-
+ FillHistoPerformance(¶m0, ¶m1, ip0, ip1, seed0, seed1,par0U);
+ MaterialBudgetDump(¶m0, ¶m1, ip0, ip1, seed0, seed1,par0U,par1U);
if (cstream) {
(*cstream) << "Track0" <<
"run="<<fRun<< // run number
// Pt cut to select straight tracks which can be easily propagated to ACORDE which is outside the magnetic field
if (upperTrack->Pt() < 10 || upperTrack->GetTPCNcls() < 80) return;
- const Double_t AcordePlane = 850.; // distance of the central Acorde detectors to the beam line at y =0
+ const Double_t acordePlane = 850.; // distance of the central Acorde detectors to the beam line at y =0
const Double_t roof = 210.5; // distance from x =0 to end of magnet roof
Double_t r[3];
Double_t d[3];
upperTrack->GetDirection(d);
Double_t x,z;
- z = r[2] + (d[2]/d[1])*(AcordePlane - r[1]);
- x = r[0] + (d[0]/d[1])*(AcordePlane - r[1]);
+ z = r[2] + (d[2]/d[1])*(acordePlane - r[1]);
+ x = r[0] + (d[0]/d[1])*(acordePlane - r[1]);
if (x > roof) {
- x = r[0] + (d[0]/(d[0]+d[1]))*(AcordePlane+roof-r[0]-r[1]);
- z = r[2] + (d[2]/(d[0]+d[1]))*(AcordePlane+roof-r[0]-r[1]);
+ x = r[0] + (d[0]/(d[0]+d[1]))*(acordePlane+roof-r[0]-r[1]);
+ z = r[2] + (d[2]/(d[0]+d[1]))*(acordePlane+roof-r[0]-r[1]);
}
if (x < -roof) {
- x = r[0] + (d[0]/(d[1]-d[0]))*(AcordePlane+roof+r[0]-r[1]);
- z = r[2] + (d[2]/(d[1]-d[0]))*(AcordePlane+roof+r[0]-r[1]);
+ x = r[0] + (d[0]/(d[1]-d[0]))*(acordePlane+roof+r[0]-r[1]);
+ z = r[2] + (d[2]/(d[1]-d[0]))*(acordePlane+roof+r[0]-r[1]);
}
fModules->Fill(z, x);
-Long64_t AliTPCcalibCosmic::Merge(TCollection *li) {
+Long64_t AliTPCcalibCosmic::Merge(TCollection *const li) {
TIterator* iter = li->MakeIterator();
AliTPCcalibCosmic* cal = 0;
funcDoubleGaus->SetParameters(hist->GetEntries()*0.75,hist->GetMean()/1.3,hist->GetMean()*0.10,
hist->GetEntries()*0.25,hist->GetMean()*1.3,hist->GetMean()*0.10);
hist->Fit(funcDoubleGaus);
- Double_t MIPvalue = TMath::Min(funcDoubleGaus->GetParameter(1),funcDoubleGaus->GetParameter(4));
+ Double_t aMIPvalue = TMath::Min(funcDoubleGaus->GetParameter(1),funcDoubleGaus->GetParameter(4));
delete funcDoubleGaus;
- return MIPvalue;
+ return aMIPvalue;
}
}
-void AliTPCcalibCosmic::BinLogX(THnSparse *h, Int_t axisDim) {
+void AliTPCcalibCosmic::BinLogX(THnSparse *const h, Int_t axisDim) {
// Method for the correct logarithmic binning of histograms
Double_t from = axis->GetXmin();
Double_t to = axis->GetXmax();
- Double_t *new_bins = new Double_t[bins + 1];
+ Double_t *newBins = new Double_t[bins + 1];
- new_bins[0] = from;
+ newBins[0] = from;
Double_t factor = pow(to/from, 1./bins);
for (int i = 1; i <= bins; i++) {
- new_bins[i] = factor * new_bins[i-1];
+ newBins[i] = factor * newBins[i-1];
}
- axis->Set(bins, new_bins);
- delete new_bins;
+ axis->Set(bins, newBins);
+ delete newBins;
}
-void AliTPCcalibCosmic::BinLogX(TH1 *h) {
+void AliTPCcalibCosmic::BinLogX(TH1 *const h) {
// Method for the correct logarithmic binning of histograms
Double_t from = axis->GetXmin();
Double_t to = axis->GetXmax();
- Double_t *new_bins = new Double_t[bins + 1];
+ Double_t *newBins = new Double_t[bins + 1];
- new_bins[0] = from;
+ newBins[0] = from;
Double_t factor = pow(to/from, 1./bins);
for (int i = 1; i <= bins; i++) {
- new_bins[i] = factor * new_bins[i-1];
+ newBins[i] = factor * newBins[i-1];
}
- axis->Set(bins, new_bins);
- delete new_bins;
+ axis->Set(bins, newBins);
+ delete newBins;
}