// --- ROOT system ---
#include <TBrowser.h>
#include <TClonesArray.h>
-#include <TH1.h>
#include <TH2.h>
#include <TParticle.h>
#include <TROOT.h>
#include "AliHeader.h"
#include "AliMC.h"
#include "AliStack.h"
-#include "AliPoints.h"
+#include "AliTrackReference.h"
// for TRD1 case only; May 31,2006
ClassImp(AliEMCALv2)
//______________________________________________________________________
AliEMCALv2::AliEMCALv2()
- : AliEMCALv1(),
- fHDe(0),
- fHNhits(0)
+ : AliEMCALv1()
{
// ctor
}
//______________________________________________________________________
AliEMCALv2::AliEMCALv2(const char *name, const char *title)
- : AliEMCALv1(name,title),
- fHDe(0),
- fHNhits(0)
+ : AliEMCALv1(name,title)
{
// Standard Creator.
fTimeCut = 30e-09;
fGeometry = GetGeometry();
- fHDe = fHNhits = 0;
- // if (gDebug>0){
- if (1){
- TH1::AddDirectory(0);
- fHDe = new TH1F("fHDe","De in EMCAL", 1000, 0., 10.);
- fHNhits = new TH1F("fHNhits","#hits in EMCAL", 2001, -0.5, 2000.5);
- fHistograms->Add(fHDe);
- fHistograms->Add(fHNhits);
- TH1::AddDirectory(1);
- }
}
//______________________________________________________________________
static TString curVolName;
static int supModuleNumber, moduleNumber, yNumber, xNumber, absid;
static int keyGeom=1; //real TRD1 geometry
- static char *vn = "SCMX"; // Apr 13, 2006 - only TRD1 case now
+ static const char *vn = "SCMX"; // Apr 13, 2006 - only TRD1 case now
static int nSMOP[7]={1,3,5,7,9,11}; // 30-mar-05
static int nSMON[7]={2,4,6,8,10,12};
static Float_t depositedEnergy=0.0;
if(gMC->VolId("WSUC")==1) printf(" WSUC - cosmic ray stand geometry \n");
}
Int_t tracknumber = gAlice->GetMCApp()->GetCurrentTrackNumber();
+ Int_t parent;
+ TParticle* part;
curVolName = gMC->CurrentVolName();
if(curVolName.Contains(vn) || curVolName.Contains("SCX")) { // We are in a scintillator layer; SCX for 3X3
if (fCurParent==-1 || tracknumber != fCurTrack) {
// Check parentage
- Int_t parent=tracknumber;
+ parent=tracknumber;
+
if (fCurParent != -1) {
while (parent != fCurParent && parent != -1) {
- TParticle *part=gAlice->GetMCApp()->Particle(parent);
+ //TParticle *part=gAlice->GetMCApp()->Particle(parent);
+ part=gAlice->GetMCApp()->Particle(parent);
parent=part->GetFirstMother();
}
}
if (fCurParent==-1 || parent==-1) {
- Int_t parent=tracknumber;
- TParticle *part=gAlice->GetMCApp()->Particle(parent);
+ //Int_t parent=tracknumber;
+ //TParticle *part=gAlice->GetMCApp()->Particle(parent);
+ parent=tracknumber;
+ part=gAlice->GetMCApp()->Particle(parent);
while (parent != -1 && fGeometry->IsInEMCAL(part->Vx(),part->Vy(),part->Vz())) {
parent=part->GetFirstMother();
if (parent!=-1)
if (fCurParent==-1)
Error("StepManager","Cannot find parent");
else {
- TParticle *part=gAlice->GetMCApp()->Particle(fCurParent);
+ //TParticle *part=gAlice->GetMCApp()->Particle(fCurParent);
+ part=gAlice->GetMCApp()->Particle(fCurParent);
ienergy = part->Energy();
+
+ //Add reference to parent in TR tree.
+ AddTrackReference(tracknumber, AliTrackReference::kEMCAL);
+
}
while (parent != -1) {
part=gAlice->GetMCApp()->Particle(parent);
if (strcmp(gMC->CurrentVolOffName(0),"SCX1")==0) xNumber=1;
else if(strcmp(gMC->CurrentVolOffName(0),"SCX2")==0) xNumber=2;
else if(strcmp(gMC->CurrentVolOffName(0),"SCX3")==0) xNumber=3;
- else Fatal("StepManager()", "Wrong name of sensetive volume in 3X3 case : %s ", gMC->CurrentVolOffName(0));
+ else Fatal("StepManager()", "Wrong name of sensitive volume in 3X3 case : %s ", gMC->CurrentVolOffName(0));
}
} else {
gMC->CurrentVolOffID(5, supModuleNumber);
}
}
-//_________________________________________________________________
-void AliEMCALv2::FinishEvent()
-{
- // Calculate deposit energy and fill control histogram; 26-may-05
- static double de=0.;
- fHNhits->Fill(double(fHits->GetEntries()));
- de = GetDepositEnergy(0);
- if(fHDe) fHDe->Fill(de);
-}
-
-//_________________________________________________________________
-Double_t AliEMCALv2::GetDepositEnergy(int print)
-{
- // 23-mar-05 - for testing
- if(fHits == 0) return 0.;
- AliEMCALHit *hit=0;
- Double_t de=0.;
- for(int ih=0; ih<fHits->GetEntries(); ih++) {
- hit = (AliEMCALHit*)fHits->UncheckedAt(ih);
- de += hit->GetEnergy();
- }
- if(print>0) {
- cout<<"AliEMCALv2::GetDepositEnergy() : fHits "<<fHits<<endl;
- printf(" #hits %i de %f \n", fHits->GetEntries(), de);
- if(print>1) {
- printf(" #primary particles %i\n", gAlice->GetHeader()->GetNprimary());
- }
- }
- return de;
-}
-
//___________________________________________________________
void AliEMCALv2::Browse(TBrowser* b)
{
st += ", zcut, ";
st += name;
- char *optShad = "on", *optHide="on";
+ const char *optShad = "on", *optHide="on";
double cxy=0.02;
if (axis==1) {
dcut = 0.;
// Size of tower is 5.6x5.6x24.8 (25.0); cut on Z axiz
TString sn(GetGeometry()->GetName());
sn.ToUpper();
- char *tit[3]={"xcut", "ycut", "zcut"};
+ const char *tit[3]={"xcut", "ycut", "zcut"};
if(axis<1) axis=1; if(axis>3) axis=3;
gMC->Gsatt("*", "seen", 0);
SetVolumeAttributes(name, 1, 5, fill); // yellow
double cxy=0.055, x0=10., y0=10.;
- char *optShad = "on", *optHide="on";
+ const char *optShad = "on", *optHide="on";
SetVolumeAttributes("STPL", 1, 3, fill); // green
if (axis==1) {
gMC->Gsatt("STPL", "seen", 0);
}
//___________________________________________________________
-void AliEMCALv2::DrawTowerCut(const char *name, int axis, double dcut, int fill, char *optShad)
+void AliEMCALv2::DrawTowerCut(const char *name, int axis, double dcut, int fill, const char *optShad)
{
// Size of tower is 5.6x5.6x24.8 (25.0); cut on Z axiz
if(axis<1) axis=1; if(axis>3) axis=3;