#include <../TPC/AliTPCseed.h>
#include <TFile.h>
+#include <TMath.h>
#include <TTree.h>
#include <TCanvas.h>
+#include <TObjArray.h>
#include "TPC/AliTPCClusterHistograms.h"
AliROCESDAnalysisSelector::AliROCESDAnalysisSelector() :
AliSelector(),
- fESDfriend(0)
+ fESDfriend(0),
+ fObjectsToSave(0)
{
//
// Constructor. Initialization of pointers
//
+ fMinNumberOfRowsIsTrack = 5;
+
+ fObjectsToSave = new TObjArray();
for (Int_t i=0; i<kTPCHists; i++)
fClusterHistograms[i] = 0;
fESD->SetESDfriend(fESDfriend);
+ Int_t flag = ProcessEvent(kFALSE);
+ if (flag==1)
+ ProcessEvent(kTRUE, Form("flash_entry%d",entry));
+
+ // TODO This should not be needed, the TTree::GetEntry() should take care of this, maybe because it has a reference member, to be analyzed
+ // if the ESDfriend is not deleted we get a major memory leak
+ // here the esdfriend seems to be also deleted, very weird behaviour....
+
+ delete fESD;
+ fESD = 0;
+
+ //delete fESDfriend;
+ //fESDfriend = 0;
+
+
+ return kTRUE;
+}
+
+Int_t AliROCESDAnalysisSelector::ProcessEvent(Bool_t detailedHistogram, const Char_t* label)
+{
+ //
+ // Looping over tracks and clusters in event and filling histograms
+ //
+ // - if detailedHistogram = kTRUE special histograms are saved (in fObjectsToSave)
+ // - the method returns
+ // 1 : if a "flash" is detected something special in this event
+ //
+
+ // save maximum 100 objects
+ if (detailedHistogram)
+ if (fObjectsToSave->GetSize()>10)
+ return 0;
+
+ // for saving single events
+ AliTPCClusterHistograms* clusterHistograms[kTPCSectors];
+ for (Int_t i=0; i<kTPCSectors; i++)
+ clusterHistograms[i] = 0;
+
+ Bool_t intToReturn = 0;
+
Int_t nTracks = fESD->GetNumberOfTracks();
Int_t nSkippedSeeds = 0;
+ Int_t nSkippedTracks = 0;
+
+ // for "flash" detection
+ Int_t nClusters = 0;
+ Float_t clusterQtotSumVsTime[250];
+ for (Int_t z=0; z<250; z++)
+ clusterQtotSumVsTime[z] = 0;
// loop over esd tracks
for (Int_t t=0; t<nTracks; t++)
{
-
AliESDtrack* esdTrack = dynamic_cast<AliESDtrack*> (fESD->GetTrack(t));
if (!esdTrack)
{
continue;
}
- if (!AcceptTrack(seed))
+ if (!AcceptTrack(seed, fMinNumberOfRowsIsTrack))
+ {
+ AliDebug(AliLog::kDebug, Form("INFO: Rejected track %d.", t));
+ nSkippedTracks++;
continue;
-
+ }
+
for (Int_t clusterID = 0; clusterID < 160; clusterID++)
{
AliTPCclusterMI* cluster = seed->GetClusterPointer(clusterID);
- if (!cluster)
- {
- //AliDebug(AliLog::kError, Form("ERROR: Could not retrieve cluster %d of track %d.", clusterID, t));
+ if (!cluster)
continue;
- }
- //AliDebug(AliLog::kDebug, Form("We found a cluster from sector %d", cluster->GetDetector()));
-
Int_t detector = cluster->GetDetector();
if (detector < 0 || detector >= kTPCSectors) {
AliDebug(AliLog::kDebug, Form("We found a cluster from invalid sector %d", detector));
continue;
}
-
- // TODO: find a clever way to handle the time
- Int_t time = 0;
-
- if (fESD->GetTimeStamp()>1160000000)
- time = fESD->GetTimeStamp();
- if (!fClusterHistograms[detector])
- fClusterHistograms[detector] = new AliTPCClusterHistograms(detector,"",time,time+7*60*60);
+ if (!detailedHistogram) {
+
+ // TODO: find a clever way to handle the time
+ Int_t time = 0;
+
+ if (fESD->GetTimeStamp()>1160000000)
+ time = fESD->GetTimeStamp();
+
+ if (!fClusterHistograms[detector])
+ fClusterHistograms[detector] = new AliTPCClusterHistograms(detector,"",time,time+5*60*60);
+
+ if (!fClusterHistograms[detector+kTPCSectors])
+ fClusterHistograms[detector+kTPCSectors] = new AliTPCClusterHistograms(detector,"",time,time+5*60*60, kTRUE);
+
+ fClusterHistograms[detector]->FillCluster(cluster, time);
+ fClusterHistograms[detector+kTPCSectors]->FillCluster(cluster, time);
+
+ Int_t z = Int_t(cluster->GetZ());
+ if (z>=0 && z<250) {
+ nClusters++;
+ clusterQtotSumVsTime[z] += cluster->GetQ();
+ }
+ } // end of if !detailedHistograms
+ else {
+ // if we need the detailed histograms for this event
+ if (!clusterHistograms[detector])
+ clusterHistograms[detector] = new AliTPCClusterHistograms(detector,label);
+
+ clusterHistograms[detector]->FillCluster(cluster);
+ }
- if (!fClusterHistograms[detector+kTPCSectors])
- fClusterHistograms[detector+kTPCSectors] = new AliTPCClusterHistograms(detector,"",time,time+7*60*60, kTRUE);
-
- fClusterHistograms[detector]->FillCluster(cluster, time);
- fClusterHistograms[detector+kTPCSectors]->FillCluster(cluster, time);
}
+
+ for (Int_t i=0; i<kTPCHists; i++)
+ if (fClusterHistograms[i])
+ fClusterHistograms[i]->FillTrack(seed);
+
}
- if (nSkippedSeeds > 0)
- printf("WARNING: The seed was not found for %d out of %d tracks.\n", nSkippedSeeds, nTracks);
+ // check if there's a very large q deposit ("flash")
+ if (!detailedHistogram) {
+ for (Int_t z=0; z<250; z++) {
+ if (clusterQtotSumVsTime[z] > 150000) {
+ printf(Form(" \n -> sum of clusters at time %d %f \n \n", z, clusterQtotSumVsTime[z]));
+ intToReturn = 1;
+ }
+ }
+ }
+ else {
+ for (Int_t i=0; i< kTPCSectors; i++) {
+ if (clusterHistograms[i]) {
+ if (fObjectsToSave->GetSize()<100) {
+ fObjectsToSave->Expand(fObjectsToSave->GetSize()+1);
+ fObjectsToSave->AddAt(clusterHistograms[i], fObjectsToSave->GetSize()-1);
+ }
+ }
+ }
+ }
- // TODO This should not be needed, the TTree::GetEntry() should take care of this, maybe because it has a reference member, to be analyzed
- // if the ESDfriend is not deleted we get a major memory leak
- // here the esdfriend seems to be also deleted, very weird behaviour....
- delete fESD;
- fESD = 0;
-
- //delete fESDfriend;
- //fESDfriend = 0;
+
+// if (nSkippedSeeds > 0)
+// printf("WARNING: The seed was not found for %d out of %d tracks.\n", nSkippedSeeds, nTracks);
+// if (nSkippedTracks > 0)
+// printf("INFO: Rejected %d out of %d tracks.\n", nSkippedTracks, nTracks);
- return kTRUE;
+ return intToReturn;
}
-
-Bool_t AliROCESDAnalysisSelector::AcceptTrack(const AliTPCseed* track) {
- //
+Bool_t AliROCESDAnalysisSelector::AcceptTrack(const AliTPCseed* track, Int_t minRowsIncluded) {
//
+ // check if the track should be accepted.
//
-
- // TODO : implement min number of rows to accept track
-
- const Int_t kMinClusters = 20;
+ const Int_t kMinClusters = 5;
const Float_t kMinRatio = 0.75;
const Float_t kMax1pt = 0.5;
+ Int_t nRowsUsedByTracks = 0;
+ Bool_t rowIncluded[96];
+
+ Float_t totalQtot = 0;
+ Int_t nClusters = 0;
+
+ for(Int_t r=0; r<96; r++)
+ rowIncluded[r] = kFALSE;
+
+ for (Int_t clusterID = 0; clusterID < 160; clusterID++) {
+ AliTPCclusterMI* cluster = track->GetClusterPointer(clusterID);
+
+ if (!cluster)
+ continue;
+
+ Float_t qTot = cluster->GetQ();
+
+ nClusters++;
+ totalQtot += qTot;
+
+ if (!rowIncluded[cluster->GetRow()]) {
+ nRowsUsedByTracks++;
+ rowIncluded[cluster->GetRow()] = kTRUE;
+ }
+ }
+
+ Float_t meanQtot = totalQtot/nClusters;
+
+ if (meanQtot<70)
+ return kFALSE;
+ if (nRowsUsedByTracks < minRowsIncluded)
+ return kFALSE;
+
+ // printf(Form(" TRACK: n clusters = %d, n pad rows = %d \n",track->GetNumberOfClusters(), nRowsUsedByTracks));
+
if (track->GetNumberOfClusters()<kMinClusters) return kFALSE;
Float_t ratio = track->GetNumberOfClusters()/(track->GetNFoundable()+1.);
if (ratio<kMinRatio) return kFALSE;
c->Close();
delete c;
}
+
+ gDirectory->mkdir("saved_objects");
+ gDirectory->cd("saved_objects");
+
+ for (Int_t i=0; i<fObjectsToSave->GetSize(); i++) {
+ if (fObjectsToSave->At(i)) {
+ AliTPCClusterHistograms* clusterHistograms = dynamic_cast<AliTPCClusterHistograms*> (fObjectsToSave->At(i));
+ if (clusterHistograms)
+ clusterHistograms->SaveHistograms();
+ else
+ fObjectsToSave->At(i)->Write();
+ }
+ }
+
+ gDirectory->cd("../");
+
+
file->Close();
}
#include <TCanvas.h>
#include <TH2F.h>
#include <TProfile2D.h>
+#include <TObjArray.h>
#include <TLatex.h>
#include <../TPC/AliTPCclusterMI.h>
+#include <../TPC/AliTPCseed.h>
#include <AliLog.h>
: TNamed(),
fhQmaxVsRow(0),
fhQtotVsRow(0),
+ fhQtotProfileVsRow(0),
+ fhQmaxProfileVsRow(0),
+ fhNClustersYVsRow(0),
+ fhNClustersZVsRow(0),
fhSigmaYVsRow(0),
fhSigmaZVsRow(0),
fhQmaxProfileYVsRow(0),
fhSigmaZProfileZVsRow(0),
fhQtotVsTime(0),
fhQmaxVsTime(0),
+ fhTrackQtotPerCluster(0),
+ fhTrackQtotPerClusterVsSnp(0),
+ fhTrackQtotPerClusterVsTgl(0),
+ fhTrackMeanQtotPerClusterVsSnp(0),
+ fhTrackMeanQtotPerClusterVsTgl(0),
fIsIROC(kFALSE),
fEdgeSuppression(kFALSE)
{
: TNamed(),
fhQmaxVsRow(0),
fhQtotVsRow(0),
+ fhQtotProfileVsRow(0),
+ fhQmaxProfileVsRow(0),
+ fhNClustersYVsRow(0),
+ fhNClustersZVsRow(0),
fhSigmaYVsRow(0),
fhSigmaZVsRow(0),
fhQmaxProfileYVsRow(0),
fhSigmaZProfileZVsRow(0),
fhQtotVsTime(0),
fhQmaxVsTime(0),
+ fhTrackQtotPerCluster(0),
+ fhTrackQtotPerClusterVsSnp(0),
+ fhTrackQtotPerClusterVsTgl(0),
+ fhTrackMeanQtotPerClusterVsSnp(0),
+ fhTrackMeanQtotPerClusterVsTgl(0),
fIsIROC(kFALSE),
fEdgeSuppression(edgeSuppression)
{
TString name(FormDetectorName(detector, edgeSuppression, comment));
+ fDetector = detector;
if (detector < 36)
fIsIROC = kTRUE;
SetName(name);
SetTitle(Form("%s (detector %d)",name.Data(), detector));
- fTimeStart = timeStart;
- fTimeStop = timeStop;
+ // rounding down to the closest 30 min
+ fTimeStart = 1800*Int_t(timeStart/1800);
+ // rounding up to the closest 30 min
+ fTimeStop = 1800*Int_t((1800 + timeStop)/1800);
+ // each time bin covers 5 min
+ Int_t nTimeBins = (fTimeStop-fTimeStart)/300;
+ // printf(Form(" start time: %d, stop time: %d \n",fTimeStart, fTimeStop));
+
#define BINNING_Z 250, 0, 250
Float_t yRange = 45;
if (fIsIROC)
{
- yRange = 25;
+ yRange = 25;
nPadRows = 63;
}
//defining histograms and profile plots
fhQmaxVsRow = new TH2F("QmaxVsPadRow", "Qmax vs. pad row;Pad row;Qmax", nPadRows+2, -1.5, nPadRows+0.5, 500, 0, 500);
fhQtotVsRow = new TH2F("QtotVsPadRow", "Qtot vs. pad row;Pad row;Qtot", nPadRows+2, -1.5, nPadRows+0.5, 400, 0, 4000);
+
+ fhQmaxProfileVsRow = new TProfile("MeanQmaxVsPadRow","Mean Qmax vs. pad row;Pad row;Mean Qmax",nPadRows+2, -1.5, nPadRows+0.5);
+ fhQtotProfileVsRow = new TProfile("MeanQtotVsPadRow","Mean Qtot vs. pad row;Pad row;Mean Qtot",nPadRows+2, -1.5, nPadRows+0.5);
+ fhNClustersYVsRow = new TH2F("NClusters y vs pad row","N clusters y vs pad;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
+ fhNClustersZVsRow = new TH2F("NClusters z vs pad row","N clusters z vs pad;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
+
fhSigmaYVsRow = new TH2F("SigmaYVsPadRow", "Sigma Y vs. pad row;Pad row;#sigma_{Y}", nPadRows+2, -1.5, nPadRows+0.5, 100, 0, 0.5);
fhSigmaZVsRow = new TH2F("SigmaZVsPadRow", "Sigma Z vs. pad row;Pad row;#sigma_{Z}", nPadRows+2, -1.5, nPadRows+0.5, 100, 0, 0.5);
fhQtotProfileZVsRow = new TProfile2D("MeanQtotZVsPadRow","Mean Qtot, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
fhSigmaYProfileZVsRow = new TProfile2D("MeanSigmaYZVsPadRow","Mean Sigma y, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
fhSigmaZProfileZVsRow = new TProfile2D("MeanSigmaZZVsPadRow","Mean Sigma z, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
-
- Int_t nTimeBins = 100;
- fhQtotVsTime = new TProfile("MeanQtotVsTime", "Mean Qtot vs. event time stamp; time; Qtot",nTimeBins, fTimeStart, fTimeStop);
- fhQmaxVsTime = new TProfile("MeanQmaxVsTime", "Mean Qmax vs. event time stamp; time; Qmax",nTimeBins, fTimeStart, fTimeStop);
+ fhQtotVsTime = new TProfile("MeanQtotVsTime", "Mean Qtot vs. time (5 min bins); time; Qtot",nTimeBins, fTimeStart, fTimeStop);
+ fhQmaxVsTime = new TProfile("MeanQmaxVsTime", "Mean Qmax vs. time (5 min bins); time; Qmax",nTimeBins, fTimeStart, fTimeStop);
+
+ fhQmaxProfileVsRow->SetLineWidth(2);
+ fhQtotProfileVsRow->SetLineWidth(2);
+
+ fhQtotVsTime->SetLineWidth(2);
+ fhQmaxVsTime->SetLineWidth(2);
+
+ // histograms related to tracks
+
+ fhTrackQtotPerCluster = new TH1F("QtotPerCluster","Qtot per cluster; (Sum Qtot)/clusters",400,0,2000);
+ fhTrackQtotPerCluster->SetMarkerStyle(22);
+ fhTrackQtotPerCluster->SetMarkerSize(1);
+
+ fhTrackQtotPerClusterVsSnp = new TH2F("QtotPerClusterVsSnp","QtotPerCluster vs Snp; Snp; (Sum Qtot)/clusters",100,-TMath::Pi(),TMath::Pi(),200,0,2000);
+ fhTrackQtotPerClusterVsTgl = new TH2F("QtotPerClusterVsTgl","QtotPerCluster vs Tgl; Tgl; (Sum Qtot)/clusters",100,-TMath::Pi(),TMath::Pi(),200,0,2000);
+
+ fhTrackMeanQtotPerClusterVsSnp = new TProfile("MeanQtotPerClusterVsSnp", "QtotPerCluster vs Snp; Snp; Mean (Sum Qtot)/clusters",100,-TMath::Pi(),TMath::Pi());
+ fhTrackMeanQtotPerClusterVsTgl = new TProfile("MeanQtotPerClusterVsTgl", "QtotPerCluster vs Tgl; Tgl; Mean (Sum Qtot)/clusters",100,-TMath::Pi(),TMath::Pi());
+
+ fhTrackMeanQtotPerClusterVsSnp->SetLineWidth(2);
+ fhTrackMeanQtotPerClusterVsTgl->SetLineWidth(2);
+
TH1::AddDirectory(oldStatus);
}
delete fhQtotVsRow;
fhQtotVsRow = 0;
}
+ if (fhQmaxProfileVsRow) {
+ delete fhQmaxProfileVsRow;
+ fhQmaxProfileVsRow = 0;
+ }
+ if (fhQtotProfileVsRow) {
+ delete fhQtotProfileVsRow;
+ fhQtotProfileVsRow = 0;
+ }
+ if (fhNClustersYVsRow) {
+ delete fhNClustersYVsRow;
+ fhNClustersYVsRow = 0;
+ }
+ if (fhNClustersZVsRow) {
+ delete fhNClustersZVsRow;
+ fhNClustersZVsRow = 0;
+ }
if (fhSigmaYVsRow) {
delete fhSigmaYVsRow;
fhSigmaYVsRow = 0;
delete fhQmaxVsTime;
fhQmaxVsTime = 0;
}
+ if (fhTrackQtotPerCluster) {
+ delete fhTrackQtotPerCluster;
+ fhTrackQtotPerCluster = 0;
+ }
+ if (fhTrackQtotPerClusterVsSnp) {
+ delete fhTrackQtotPerClusterVsSnp;
+ fhTrackQtotPerClusterVsSnp = 0;
+ }
+ if (fhTrackQtotPerClusterVsTgl) {
+ delete fhTrackQtotPerClusterVsTgl;
+ fhTrackQtotPerClusterVsTgl = 0;
+ }
+ if (fhTrackMeanQtotPerClusterVsSnp) {
+ delete fhTrackMeanQtotPerClusterVsSnp;
+ fhTrackMeanQtotPerClusterVsSnp = 0;
+ }
+ if (fhTrackMeanQtotPerClusterVsTgl) {
+ delete fhTrackMeanQtotPerClusterVsTgl;
+ fhTrackMeanQtotPerClusterVsTgl = 0;
+ }
}
//____________________________________________________________________
if (detector<18 || ( detector>=36 && detector<54))
side.Form("A");
else
- side.Form("B");
+ side.Form("C");
if (detector<36)
inout.Form("IROC");
// collections of measured and generated histograms
TList* collectionQmaxVsRow = new TList;
TList* collectionQtotVsRow = new TList;
+
+ TList* collectionQmaxProfileVsRow = new TList;
+ TList* collectionQtotProfileVsRow = new TList;
+
+ TList* collectionNClustersYVsRow = new TList;
+ TList* collectionNClustersZVsRow = new TList;
+
TList* collectionSigmaYVsRow = new TList;
TList* collectionSigmaZVsRow = new TList;
TList* collectionQtotVsTime = new TList;
TList* collectionQmaxVsTime = new TList;
+ TList* collectionTrackQtotPerCluster = new TList;
+
+ TList* collectionTrackQtotPerClusterVsSnp = new TList;
+ TList* collectionTrackQtotPerClusterVsTgl = new TList;
+
+ TList* collectionTrackMeanQtotPerClusterVsSnp = new TList;
+ TList* collectionTrackMeanQtotPerClusterVsTgl = new TList;
+
+
Int_t count = 0;
while ((obj = iter->Next())) {
collectionQmaxVsRow ->Add(entry->fhQmaxVsRow );
collectionQtotVsRow ->Add(entry->fhQtotVsRow );
+
+ collectionQmaxProfileVsRow ->Add(entry->fhQmaxProfileVsRow );
+ collectionQtotProfileVsRow ->Add(entry->fhQtotProfileVsRow );
+
+ collectionNClustersYVsRow ->Add(entry->fhNClustersYVsRow);
+ collectionNClustersZVsRow ->Add(entry->fhNClustersZVsRow);
+
collectionSigmaYVsRow ->Add(entry->fhSigmaYVsRow );
collectionSigmaZVsRow ->Add(entry->fhSigmaZVsRow );
collectionQtotVsTime->Add(entry->fhQtotVsTime);
collectionQmaxVsTime->Add(entry->fhQmaxVsTime);
+ collectionTrackQtotPerCluster->Add(entry->fhTrackQtotPerCluster);
+
+ collectionTrackQtotPerClusterVsSnp->Add(entry->fhTrackQtotPerClusterVsSnp);
+ collectionTrackQtotPerClusterVsTgl->Add(entry->fhTrackQtotPerClusterVsTgl);
+
+ collectionTrackMeanQtotPerClusterVsSnp->Add(entry->fhTrackMeanQtotPerClusterVsSnp);
+ collectionTrackMeanQtotPerClusterVsTgl->Add(entry->fhTrackMeanQtotPerClusterVsTgl);
count++;
}
fhQmaxVsRow ->Merge(collectionQmaxVsRow );
fhQtotVsRow ->Merge(collectionQtotVsRow );
+
+ fhQmaxProfileVsRow ->Merge(collectionQmaxProfileVsRow);
+ fhQtotProfileVsRow ->Merge(collectionQtotProfileVsRow);
+
+ fhNClustersYVsRow ->Merge(collectionNClustersYVsRow);
+ fhNClustersZVsRow ->Merge(collectionNClustersZVsRow);
+
fhSigmaYVsRow ->Merge(collectionSigmaYVsRow );
fhSigmaZVsRow ->Merge(collectionSigmaZVsRow );
fhQtotVsTime->Merge(collectionQtotVsTime);
fhQmaxVsTime->Merge(collectionQmaxVsTime);
+ fhTrackQtotPerCluster->Merge(collectionTrackQtotPerCluster);
+
+ fhTrackQtotPerClusterVsSnp->Merge(collectionTrackQtotPerClusterVsSnp);
+ fhTrackQtotPerClusterVsTgl->Merge(collectionTrackQtotPerClusterVsTgl);
+
+ fhTrackMeanQtotPerClusterVsSnp->Merge(collectionTrackMeanQtotPerClusterVsSnp);
+ fhTrackMeanQtotPerClusterVsTgl->Merge(collectionTrackMeanQtotPerClusterVsTgl);
+
delete collectionQmaxVsRow;
delete collectionQtotVsRow;
+
+ delete collectionQmaxProfileVsRow;
+ delete collectionQtotProfileVsRow;
+
+ delete collectionNClustersYVsRow;
+ delete collectionNClustersZVsRow;
+
delete collectionSigmaYVsRow;
delete collectionSigmaZVsRow;
delete collectionQtotVsTime;
delete collectionQmaxVsTime;
+ delete collectionTrackQtotPerCluster;
+
+ delete collectionTrackQtotPerClusterVsSnp;
+ delete collectionTrackQtotPerClusterVsTgl;
+
+ delete collectionTrackMeanQtotPerClusterVsSnp;
+ delete collectionTrackMeanQtotPerClusterVsTgl;
+
return count+1;
}
+
//____________________________________________________________________
void AliTPCClusterHistograms::FillCluster(AliTPCclusterMI* cluster, Int_t time) {
//
Float_t y = cluster->GetY();
Float_t z = cluster->GetZ();
+ // check if this is ok!!!
+ z = TMath::Abs(z);
+
if (qMax<=0) {
printf(Form("\n WARNING: Hi Marian! How can we have Qmax = %f ??? \n \n", qMax));
return;
return;
}
+
+ // check if the cluster is accepted
if (fEdgeSuppression)
- {
- Float_t limit = 0;
- if (fIsIROC)
- {
- limit = 12 + padRow * (20.0 - 12.0) / 63;
- }
- else
- limit = 16 + padRow * (36.0 - 16.0) / 96;
-
- if (TMath::Abs(y) > limit)
- return;
- }
+ if (IsClusterOnEdge(cluster))
+ return;
fhQmaxVsRow ->Fill(padRow, qMax);
fhQtotVsRow ->Fill(padRow, qTot);
+
+ fhQmaxProfileVsRow ->Fill(padRow, qMax);
+ fhQtotProfileVsRow ->Fill(padRow, qTot);
+
+ fhNClustersYVsRow ->Fill(padRow, y, 1);
+ fhNClustersZVsRow ->Fill(padRow, z, 1);
fhSigmaYVsRow ->Fill(padRow, sigmaY);
fhSigmaZVsRow ->Fill(padRow, sigmaZ);
fhQtotVsTime->Fill(time,qTot);
fhQmaxVsTime->Fill(time,qMax);
}
+}
+
+//____________________________________________________________________
+void AliTPCClusterHistograms::FillTrack(const AliTPCseed* seed) {
+ //
+ // fill histograms related to tracks
+ //
+
+ Float_t totalQtot = 0;
+ Int_t nClusters = 0;
+ for (Int_t clusterID = 0; clusterID < 160; clusterID++) {
+ AliTPCclusterMI* cluster = seed->GetClusterPointer(clusterID);
+ if (!cluster)
+ continue;
+
+ // only use clusters within this detector
+ if (cluster->GetDetector()!=fDetector)
+ continue;
+
+ // check if the cluster is accepted
+ if (fEdgeSuppression)
+ if (IsClusterOnEdge(cluster))
+ return;
+ Int_t padRow = cluster->GetRow();
+ Float_t qMax = cluster->GetMax();
+ Float_t qTot = cluster->GetQ();
+
+ nClusters++;
+ totalQtot += qTot;
+
+ }
+ if (nClusters==0)
+ return;
+
+ Float_t meanQtot = totalQtot/nClusters;
+
+ Float_t snp = TMath::ASin(seed->GetSnp());
+ Float_t tgl = TMath::ATan(seed->GetTgl());
+
+ fhTrackQtotPerCluster->Fill(meanQtot);
+
+ fhTrackMeanQtotPerClusterVsSnp->Fill(snp, meanQtot);
+ fhTrackMeanQtotPerClusterVsTgl->Fill(tgl, meanQtot);
+
+ fhTrackQtotPerClusterVsSnp->Fill(snp, meanQtot);
+ fhTrackQtotPerClusterVsTgl->Fill(tgl, meanQtot);
+
+}
+
+//____________________________________________________________________
+Bool_t AliTPCClusterHistograms::IsClusterOnEdge(AliTPCclusterMI* clusterMI) {
+ //
+ // check if the cluster is on the edge
+ //
+
+ Int_t padRow = clusterMI->GetRow();
+ Float_t y = clusterMI->GetY();
+
+ Float_t limit = 0;
+ if (fIsIROC)
+ {
+ limit = 12 + padRow * (20.0 - 12.0) / 63;
+ }
+ else
+ limit = 16 + padRow * (36.0 - 16.0) / 96;
+
+ if (TMath::Abs(y) > limit)
+ return kTRUE;
+
+ return kFALSE;
}
+
//____________________________________________________________________
void AliTPCClusterHistograms::SaveHistograms()
{
gDirectory->mkdir(fName.Data());
gDirectory->cd(fName.Data());
+ //TTimeStamp* t = new TTimeStamp(timeStart);
+ //TNamed* time = new TNamed("timeStart", Form("%d",t->GetDate())
+
fhQmaxVsRow ->Write();
fhQtotVsRow ->Write();
+
+ fhQmaxProfileVsRow ->Write();
+ fhQtotProfileVsRow ->Write();
+
+ fhNClustersYVsRow ->Write();
+ fhNClustersZVsRow ->Write();
fhSigmaYVsRow ->Write();
fhSigmaZVsRow ->Write();
fhSigmaYProfileZVsRow ->Write();
fhSigmaZProfileZVsRow ->Write();
- TProfile* profileQmaxVsRow = fhQmaxVsRow->ProfileX("MeanQmaxVsRow");
- TProfile* profileQtotVsRow = fhQtotVsRow->ProfileX("MeanQtotVsRow");
-
- profileQmaxVsRow->SetTitle("Mean Qmax vs. pad row; Pad row; Mean Qmax");
- profileQtotVsRow->SetTitle("Mean Qtot vs. pad row; Pad row; Mean Qmax");
-
- profileQmaxVsRow->Write();
- profileQtotVsRow->Write();
-
if (fhQtotVsTime->GetEntries()>0)
fhQtotVsTime->Write();
if (fhQmaxVsTime->GetEntries()>0)
fhQmaxVsTime->Write();
+
+ gDirectory->mkdir("track_hists");
+ gDirectory->cd("track_hists");
+
+ fhTrackQtotPerCluster->Write();
+
+ fhTrackQtotPerClusterVsSnp->Write();
+ fhTrackQtotPerClusterVsTgl->Write();
+
+ fhTrackMeanQtotPerClusterVsSnp->Write();
+ fhTrackMeanQtotPerClusterVsTgl->Write();
+
+ gDirectory->cd("../");
+
gDirectory->cd("../");
}
// this is not really a nice way to do it...
c->GetPad(1)->Delete();
- TLatex* name = new TLatex(0.1,0.8,fName.Data());
- name->SetTextSize(0.02);
- name->DrawClone();
+ TLatex* tName = new TLatex(0.05,0.9,fName.Data());
+ tName->SetTextSize(0.02);
+ tName->DrawClone();
+
+ TLatex* tEdge;
+ if (fEdgeSuppression)
+ tEdge = new TLatex(0.05,0.85,"(edges cut)");
+ else
+ tEdge = new TLatex(0.05,0.85,"(no edge cut)");
+
+ tEdge->SetTextSize(0.015);
+ tEdge->DrawClone();
c->cd(2);
fhQmaxVsRow->Draw("colz");
+ fhQmaxProfileVsRow->Draw("same");
c->cd(3);
- fhQtotVsRow->Draw("colz");
+ fhQtotVsRow->Draw("colz");
+ fhQtotProfileVsRow->Draw("same");
c->cd(4);
fhQmaxProfileYVsRow ->Draw("colz");
+
c->cd(5);
fhQtotProfileYVsRow ->Draw("colz");
+
c->cd(6);
fhQmaxProfileZVsRow ->Draw("colz");
+
c->cd(7);
fhQtotProfileZVsRow ->Draw("colz");
+
c->cd(8);
+
fhSigmaYVsRow ->Draw("colz");
c->cd(9);