//*-- An object of this class does not produce digits
//*-- It is the one to use if you do want to produce outputs in TREEH
//*--
-//*-- Author : Aleksei Pavlinov (WSU)
+//*-- Author : Alexei Pavlinov (WSU)
// This Class not stores information on all particles prior to EMCAL entry - in order to facilitate analysis.
// This is done by setting fIShunt =2, and flagging all parents of particles entering the EMCAL.
{
// Standard Creator.
- fHits= new TClonesArray("AliEMCALHit",1000);
+ //fHits= new TClonesArray("AliEMCALHit",1000); //Already done in ctor of v1
gAlice->GetMCApp()->AddHitList(fHits);
fNhits = 0;
AliEMCALv2::~AliEMCALv2(){
// dtor
- if ( fHits) {
- fHits->Delete();
- delete fHits;
- fHits = 0;
- }
+ //Already done in dtor of v1
+// if ( fHits ) {
+// fHits->Clear();
+// delete fHits;
+// fHits = 0;
+// }
}
//______________________________________________________________________
// Add a hit to the hit list.
// An EMCAL hit is the sum of all hits in a tower section
// originating from the same entering particle
- static Int_t hitCounter=0.;
- static AliEMCALHit *newHit=0, *curHit=0;
- static Bool_t deja=kFALSE;
+ static Int_t hitCounter;
+ static AliEMCALHit *newHit, *curHit;
+ static Bool_t deja ;
+
+ deja = kFALSE;
newHit = new AliEMCALHit(shunt, primary, tracknumber, iparent, ienergy, id, hits, p);
for ( hitCounter = fNhits-1; hitCounter >= 0 && !deja; hitCounter-- ) {
void AliEMCALv2::DrawCalorimeterCut(const char *name, int axis, double dcut)
{
// Size of tower is 5.6x5.6x24.8 (25.0); cut on Z axiz
- TString g(fGeometry->GetName());
+ TString g(GetGeometry()->GetName());
g.ToUpper();
gMC->Gsatt("*", "seen", 0);
gMC->Gdopt("shad", optShad);
gROOT->ProcessLine("TGeant3 *g3 = (TGeant3*)gMC");
- char cmd[200];
- sprintf(cmd,"g3->Gdrawc(\"XEN1\", %i, %5.1f, 12., 8., %3.2f, %3.2f)\n", axis, dcut, cxy,cxy);
+ const Int_t buffersize = 255;
+ char cmd[buffersize];
+ snprintf(cmd,buffersize,"g3->Gdrawc(\"XEN1\", %i, %5.1f, 12., 8., %3.2f, %3.2f)\n", axis, dcut, cxy,cxy);
printf("\n%s\n",cmd); gROOT->ProcessLine(cmd);
- sprintf(cmd,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
+ snprintf(cmd,buffersize,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
printf("%s\n",cmd); gROOT->ProcessLine(cmd);
}
st += tit[axis-1];;
gROOT->ProcessLine("TGeant3 *g3 = (TGeant3*)gMC");
- char cmd[200];
- sprintf(cmd,"g3->Gdrawc(\"SMOD\", %i, %6.3f, %5.1f, %5.1f, %5.3f, %5.3f)\n",axis,dcut,x0,y0,cxy,cxy);
+ const Int_t buffersize = 255;
+ char cmd[buffersize];
+ snprintf(cmd,buffersize,"g3->Gdrawc(\"SMOD\", %i, %6.3f, %5.1f, %5.1f, %5.3f, %5.3f)\n",axis,dcut,x0,y0,cxy,cxy);
printf("\n%s\n",cmd); gROOT->ProcessLine(cmd);
- sprintf(cmd,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
+ snprintf(cmd,buffersize,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
printf("%s\n",cmd); gROOT->ProcessLine(cmd);
// hint for testing
printf("Begin of super module\n");
if (mn.Contains("EMOD")) {
cx = cy = 0.5;
}
- char cmd[200];
+ const Int_t buffersize = 255;
+ char cmd[buffersize];
gMC->Gdopt("hide", optShad);
gMC->Gdopt("shad", optShad);
- sprintf(cmd,"g3->Gdrawc(\"%s\", %i, %6.2f, 10., 10., %5.3f, %5.3f)\n",name, axis,dcut,cx,cy);
+ snprintf(cmd,buffersize,"g3->Gdrawc(\"%s\", %i, %6.2f, 10., 10., %5.3f, %5.3f)\n",name, axis,dcut,cx,cy);
printf("\n%s\n",cmd); gROOT->ProcessLine(cmd);
- sprintf(cmd,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
+ snprintf(cmd,buffersize,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
printf("%s\n",cmd); gROOT->ProcessLine(cmd);
}