//*-- 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.
}
//______________________________________________________________________
-AliEMCALv2::AliEMCALv2(const char *name, const char *title)
- : AliEMCALv1(name,title)
+AliEMCALv2::AliEMCALv2(const char *name, const char *title,
+ const Bool_t checkGeoAndRun)
+ : AliEMCALv1(name,title,checkGeoAndRun)
{
// Standard Creator.
- fHits= new TClonesArray("AliEMCALHit",1000);
+ //fHits= new TClonesArray("AliEMCALHit",1000); //Already done in ctor of v1
gAlice->GetMCApp()->AddHitList(fHits);
fNhits = 0;
fIshunt = 2; // All hits are associated with particles entering the calorimeter
fTimeCut = 30e-09;
-
+
fGeometry = GetGeometry();
}
AliEMCALv2::~AliEMCALv2(){
// dtor
- if ( fHits ) {
- fHits->Clear();
- delete fHits;
- fHits = 0;
- }
+ //Already done in dtor of v1
+// if ( fHits ) {
+// fHits->Clear();
+// delete fHits;
+// fHits = 0;
+// }
}
//______________________________________________________________________
gMC->CurrentVolOffID(1, yNumber);
gMC->CurrentVolOffID(0, xNumber); // really x number now
if(strcmp(gMC->CurrentVolOffName(4),"SM10")==0) supModuleNumber += 10; // 13-oct-05
+ if(strcmp(gMC->CurrentVolOffName(4),"SM3rd")==0) supModuleNumber += 10; // 1-feb-12
// Nov 10,2006
if(strcmp(gMC->CurrentVolOffName(0),vn) != 0) { // 3X3 case
if (strcmp(gMC->CurrentVolOffName(0),"SCX1")==0) xNumber=1;
ieta = ((fGeometry->GetCentersOfCellsEtaDir()).GetSize()-1)-ieta;// 47-ieta, revert the ordering on A side in order to keep convention.
}
else {
- if(smNumber >= 10) smType = 2 ; //half supermodule
+ if(smNumber >= 10 && strcmp(gMC->CurrentVolOffName(4),"SM10")==0) smType = 2 ; //half supermodule. previous design/idea
+ if(smNumber >= 10 && strcmp(gMC->CurrentVolOffName(4),"SM3rd")==0) smType = 3 ; //one third (installed in 2012) supermodule
iphi= ((fGeometry->GetCentersOfCellsPhiDir()).GetSize()/smType-1)-iphi;//23-iphi, revert the ordering on C side in order to keep convention.
}
} // there is deposited energy
}
}
-
-//___________________________________________________________
-void AliEMCALv2::Browse(TBrowser* b)
-{
- TObject::Browse(b);
-}
-
-//___________________________________________________________
-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());
- g.ToUpper();
- gMC->Gsatt("*", "seen", 0);
-
- int fill = 1;
-
- if(axis!=1) SetVolumeAttributes("STPL", 1, 1, fill);
-
- int colo=4;
- TString sn(name);
- if(sn.Contains("SCM")) colo=5;
- SetVolumeAttributes(name, 1, colo, fill);
- if(g.Contains("110DEG") && sn=="SMOD") SetVolumeAttributes("SM10", 1, colo, fill);
-
- TString st(GetTitle());
- st += ", zcut, ";
- st += name;
-
- const char *optShad = "on", *optHide="on";
- double cxy=0.02;
- if (axis==1) {
- dcut = 0.;
- // optHide = optShad = "off";
- } else if(axis==2){
- if(dcut==0.) SetVolumeAttributes("SCM0", 1, 5, fill); // yellow
- }
-
- gMC->Gdopt("hide", optHide);
- 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);
- printf("\n%s\n",cmd); gROOT->ProcessLine(cmd);
-
- sprintf(cmd,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
- printf("%s\n",cmd); gROOT->ProcessLine(cmd);
-}
-
-//___________________________________________________________
-void AliEMCALv2::DrawSuperModuleCut(const char *name, int axis, double dcut, int fill)
-{
- // Size of tower is 5.6x5.6x24.8 (25.0); cut on Z axiz
- TString sn(GetGeometry()->GetName());
- sn.ToUpper();
- const char *tit[3]={"xcut", "ycut", "zcut"};
- if(axis<1) axis=1; if(axis>3) axis=3;
-
- gMC->Gsatt("*", "seen", 0);
- // int fill = 6;
-
- // SetVolumeAttributes("SMOD", 1, 1, fill); // black
- SetVolumeAttributes(name, 1, 5, fill); // yellow
-
- double cxy=0.055, x0=10., y0=10.;
- const char *optShad = "on", *optHide="on";
- SetVolumeAttributes("STPL", 1, 3, fill); // green
- if (axis==1) {
- gMC->Gsatt("STPL", "seen", 0);
- dcut = 0.;
- optHide = "off";
- optShad = "off";
- } else if(axis==3) cxy = 0.1;
-
- gMC->Gdopt("hide", optHide);
- gMC->Gdopt("shad", optShad);
-
- TString st("Shish-Kebab, Compact, SMOD, ");
- 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);
- printf("\n%s\n",cmd); gROOT->ProcessLine(cmd);
-
- sprintf(cmd,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
- printf("%s\n",cmd); gROOT->ProcessLine(cmd);
- // hint for testing
- printf("Begin of super module\n");
- printf("g3->Gdrawc(\"SMOD\", 2, 0.300, 89., 10., 0.5, 0.5)\n");
- printf("Center of super modules\n");
- printf("g3->Gdrawc(\"SMOD\", 2, 0.300, 0., 10., 0.5, 0.5)\n");
- printf("end of super modules\n");
- printf("g3->Gdrawc(\"SMOD\", 2, 0.300, -70., 10., 0.5, 0.5)\n");
-}
-
-//___________________________________________________________
-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;
- TString mn(name); mn.ToUpper();
- TString sn(GetGeometry()->GetName());
-
- gMC->Gsatt("*", "seen", 0);
- gMC->Gsatt("*", "fill", fill);
-
- // int mainColo=5; // yellow
- if(mn == "EMOD") {
- SetVolumeAttributes(mn.Data(), 1, 1, fill);
- SetVolumeAttributes("SCM0", 1, 5, fill); // yellow
- SetVolumeAttributes("SCPA", 1, 3, fill); // green - 13-may-05
- } else if(mn == "SCM0") { // first division
- SetVolumeAttributes(mn.Data(), 1, 1, fill);
- SetVolumeAttributes("SCMY", 1, 5, fill); // yellow
- } else if(mn == "SCMY") { // first division
- SetVolumeAttributes(mn.Data(), 1, 1, fill);
- SetVolumeAttributes("SCMX", 1, 5, fill); // yellow
- } else if(mn == "SCMX" || mn.Contains("SCX")) {
- SetVolumeAttributes(mn.Data(), 1, 5, fill);// yellow
- SetVolumeAttributes("PBTI", 1, 4, fill);
- } else {
- printf("<W> for volume |%s| did not defined volume attributes\n", mn.Data());
- }
-
- TString st("Shashlyk, 2x2 mm sampling, 77 layers, ");
- st += name;
-
- gROOT->ProcessLine("TGeant3 *g3 = (TGeant3*)gMC");
- double cx=0.78, cy=2.;
- if (mn.Contains("EMOD")) {
- cx = cy = 0.5;
- }
- char cmd[200];
-
- 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);
- printf("\n%s\n",cmd); gROOT->ProcessLine(cmd);
-
- sprintf(cmd,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
- printf("%s\n",cmd); gROOT->ProcessLine(cmd);
-}
-
-//___________________________________________________________
-void AliEMCALv2::DrawAlicWithHits(int mode)
-{
- // 20-sep-04; does not work now
- static TH2F *h2;
- if(h2==0) h2 = new TH2F("h2","test fo hits", 60,0.5,60.5, 28,0.5,28.5);
- else h2->Reset();
- if(mode==0) {
- gROOT->ProcessLine("TGeant3 *g3 = (TGeant3*)gMC");
- gMC->Gsatt("*","seen",0);
- gMC->Gsatt("scm0","seen",5);
-
- gROOT->ProcessLine("g3->Gdrawc(\"ALIC\", 1, 2.0, 12., -130, 0.3, 0.3)");
- // g3->Gdrawc("ALIC", 1, 2.0, 10., -14, 0.05, 0.05)
- }
-
- TClonesArray *hits = Hits();
- Int_t nhits = hits->GetEntries(), absId, nSupMod, nModule, nIphi, nIeta, iphi, ieta;
- AliEMCALHit *hit = 0;
- Double_t de=0., des=0.;
- for(Int_t i=0; i<nhits; i++) {
- hit = (AliEMCALHit*)hits->UncheckedAt(i);
- absId = hit->GetId();
- de = hit->GetEnergy();
- des += de;
- if(fGeometry->GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta)){
- // printf(" de %f abs id %i smod %i tower %i | cell iphi %i : ieta %i\n",
- // de, absId, nSupMod, nModule, nIphi, nIeta);
- if(nSupMod==3) {
- fGeometry->GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, iphi,ieta);
- // printf(" iphi %i : ieta %i\n", iphi,ieta);
- h2->Fill(double(ieta),double(iphi), de);
- }
- }
- // hit->Dump();
- }
- printf(" #hits %i : sum de %f -> %f \n", nhits, des, h2->Integral());
- if(mode>0 && h2->Integral()>0.) h2->Draw();
-}
-
-//___________________________________________________________
-void AliEMCALv2::SetVolumeAttributes(const char *name, int seen, int color, int fill)
-{
- /* seen=-2:volume is visible but none of its descendants;
- -1:volume is not visible together with all its descendants;
- 0:volume is not visible;
- 1:volume is visible. */
- gMC->Gsatt(name, "seen", seen);
- gMC->Gsatt(name, "colo", color);
- gMC->Gsatt(name, "fill", fill);
- printf(" %s : seen %i color %i fill %i \n", name, seen, color, fill);
-}
-
-//___________________________________________________________
-void AliEMCALv2::TestIndexTransition(int pri, int idmax)
-{
- // Test for EMCAL SHISHKEBAB geometry
-
- Int_t nSupMod, nModule, nIphi, nIeta, idNew, nGood=0;
- if(idmax==0) idmax = fGeometry->GetNCells();
- for(Int_t id=1; id<=idmax; id++) {
- if(!fGeometry->GetCellIndex(id, nSupMod, nModule, nIphi, nIeta)){
- printf(" Wrong abs ID %i : #cells %i\n", id, fGeometry->GetNCells());
- break;
- }
- idNew = fGeometry->GetAbsCellId(nSupMod, nModule, nIphi, nIeta);
- if(id != idNew || pri>0) {
- printf(" ID %i : %i <- new id\n", id, idNew);
- printf(" nSupMod %i ", nSupMod);
- printf(" nModule %i ", nModule);
- printf(" nIphi %i ", nIphi);
- printf(" nIeta %i \n", nIeta);
-
- } else nGood++;
- }
- printf(" Good decoding %i : %i <- #cells \n", nGood, fGeometry->GetNCells());
-}