//The histograms. We use a TObjArray instead of a simple array,because this gives automatic streaming properties for the
//class. A TClonesArray would be more efficient, but it's a bit more difficult to use and it doesn't matter too much
- //since we have only around 12 objects (maximum) in the array anyway.
+ //since we have only around 22 objects (maximum) in the array anyway.
TObjArray fPedestalLowGain; // pedestal info for low gain
TObjArray fPedestalHighGain; // pedestal info for high gain
TObjArray fPedestalLEDRefLowGain; // pedestal LEDRef info for low gain
//Trigger sdigits
if(!fTriggerData)fTriggerData = new AliEMCALTriggerData();
fTriggerData->SetMode(1);
- TClonesArray *digitsTrg = new TClonesArray("AliEMCALTriggerRawDigit", 32 * 96);
+ const Int_t nTRU = GetGeometry()->GetNTotalTRU();
+ TClonesArray *digitsTrg = new TClonesArray("AliEMCALTriggerRawDigit", nTRU * 96);
Int_t bufsize = 32000;
treeS->Branch("EMTRG", &digitsTrg, bufsize);
//Default geometry
//Complete EMCAL geometry, 12 SM. Year 2012 and on
- if(!geoName.Contains("COMPLETE12SMV1"))
- {
- AliInfo(Form("*** ATTENTION *** \n \t Specified geometry name <<%s>> for run %d is not considered! \n \t In use <<EMCAL_COMPLETE12SMV1>>, check run number and year \n ",
- geoName.Data(),runNumber));
- }
- else
- {
+ if(geoName.Contains("COMPLETE12SMV1") && geoName.Contains("DCAL")){
+ if(geoName.Contains("DCAL_DEV")) {
+ return AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1_DCAL_DEV","EMCAL",mcname,mctitle) ;
+ } else if(geoName.Contains("DCAL_8SM")) {
+ return AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1_DCAL_8SM","EMCAL",mcname,mctitle) ;
+ }else
+ return AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1_DCAL","EMCAL",mcname,mctitle) ;
+ } else if(!geoName.Contains("COMPLETE12SMV1")){
+ AliInfo(Form("*** ATTENTION *** \n \t Specified geometry name <<%s>> for run %d is not considered! \n \t In use <<EMCAL_COMPLETE12SMV1>>, check run number and year \n ", geoName.Data(),runNumber));
+ } else {
AliDebug(1,"Initialized geometry with name <<EMCAL_COMPLETE12SMV1>>");
}
// Read and Write txt I/O methods are normally not used, but are useful for
// filling the object before it is saved in OCDB
- void ReadTextBiasAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void WriteTextBiasAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void ReadRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void ReadTreeBiasAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void WriteRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
+ void ReadTextBiasAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void WriteTextBiasAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void ReadRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void ReadTreeBiasAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void WriteRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
virtual ~AliEMCALBiasAPD();
///*-- Author: Yves Schutz (SUBATECH)
// : Aleksei Pavlinov (WSU); Jun 30, 2006 - ALICE numbering scheme
// : Add decalibration and time calibration arrays: Jul 21, 2011 (GCB)
+// : adapted for DCAL by M.L. Wang CCNU & Subatech Oct-18-2012
///////////////////////////////////////////////////////////////////////////////
// //
// class for EMCAL calibration //
SetTitle(calibda.GetName());
Reset();
- Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //22
Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
- Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows; //12 - Modules 11 and 12 are half modules
- // in reality they are 1/3 but leave them as 1/2
- for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
-
- if(supermodule >= 10)
- nRow = nRow2;
+ for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
for(Int_t column = 0; column<nCol; column++) {
fADCchannelRef = calibda.GetADCchannelRef() ;
- Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //22
Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
- Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
+
+ for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
// in reality they are 1/3 but leave them as 1/2
- for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
-
- if(supermodule >= 10)
- nRow = nRow2;
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
for(Int_t column = 0; column<nCol; column++) {
fADCchannelRef = 0.0162;
- Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //22
Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
- Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
+
+ for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
// in reality they are 1/3 but leave them as 1/2
+
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
- for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
for (Int_t column=0; column < nCol; column++){
for (Int_t row = 0; row < nRow; row++){
// Print tables of pedestals and ADC channels widths
// options are: "gain", "ped", "decal", "time", "all"
- Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //22
Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
- Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
- // in reality they are 1/3 but leave them as 1/2
-
+
if (strstr(option,"ped") || strstr(option,"all")) {
printf("\n ---- Pedestal values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
if (strstr(option,"gain") || strstr(option,"all")) {
printf("\n ---- ADC channel values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
if (strstr(option,"adcdecal") || strstr(option,"all")) {
printf("\n ---- ADC decalibration channel values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
if (strstr(option,"time") || strstr(option,"all")) {
printf("\n ---- time channel values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
if (strstr(option,"time") || strstr(option,"all")) {
printf("\n ---- time decalibration channel values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
// Read and Write txt I/O methods are normally not used, but are useful for
// filling the object before it is saved in OCDB
- void ReadTextCalibMapAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void WriteTextCalibMapAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void ReadRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void ReadTreeCalibMapAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void WriteRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
+ void ReadTextCalibMapAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void WriteTextCalibMapAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void ReadRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void ReadTreeCalibMapAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void WriteRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
virtual ~AliEMCALCalibMapAPD();
// Read and Write txt I/O methods are normally not used, but are useful for
// filling the object before it is saved in OCDB
- void ReadTextCalibReferenceInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void WriteTextCalibReferenceInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void ReadRootCalibReferenceInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void ReadTreeCalibReferenceInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void WriteRootCalibReferenceInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
+ void ReadTextCalibReferenceInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void WriteTextCalibReferenceInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void ReadRootCalibReferenceInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void ReadTreeCalibReferenceInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void WriteRootCalibReferenceInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
virtual ~AliEMCALCalibReference();
// Read and Write txt I/O methods are normally not used, but are useful for
// filling the object before it is saved in OCDB
- void ReadTextInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void WriteTextInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void ReadRootInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void ReadTreeInfo(TTree *treeGlob, TTree *treeCorr, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
- void WriteRootInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
+ void ReadTextInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void WriteTextInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void ReadRootInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void ReadTreeInfo(TTree *treeGlob, TTree *treeCorr, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
+ void WriteRootInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 22 SuperModules
virtual ~AliEMCALCalibTimeDepCorrection();
nEvents = fLastEvent - fFirstEvent + 1;
Int_t ievent = -1;
- TClonesArray* digitsTMP = new TClonesArray("AliEMCALDigit", 32*96);
- TClonesArray* digitsTRG = new TClonesArray("AliEMCALRawDigit", 32*96);
+ AliEMCALGeometry *geom = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"))->GetGeometry();
+ const Int_t nTRU = geom->GetNTotalTRU();
+ TClonesArray* digitsTMP = new TClonesArray("AliEMCALDigit", nTRU*96);
+ TClonesArray* digitsTRG = new TClonesArray("AliEMCALRawDigit", nTRU*96);
rl->LoadSDigits("EMCAL");
for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
if (AliDebugLevel()) printf("Number of TRG digits: %d\n",digitsTMP->GetEntriesFast());
- Int_t nSamples = 32;
+ Int_t nSamples = geom->GetNTotalTRU();
Int_t *timeSamples = new Int_t[nSamples];
NextDigit = TIter(digitsTMP);
// drawing (end of October 2010).
// 3. COMPLETEV1 contains now only 10 SM for runs for year 2011
// 4. COMPLETE12SMV1 contains 12 SM for runs from year 2012 and on
+// 5. COMPLETE12SMV1_DCAL contains 12 SM and 6 DCal SM
+// 6. COMPLETE12SMV1_DCAL_DEV contains 12 SM and 10 DCal SM
+// 7. COMPLETE12SMV1_DCAL_8SM contains 12 SM and 6 DCal SM and 2 extentions
//
// EMCAL_WSUC (Wayne State test stand)
// = no definite equivalent in old notation, was only used by
// and : Jennifer Klay (LBL)
// and : Aleksei Pavlinov (WSU)
// and : Magali Estienne (SUBATECH)
+// and : Adapted for DCAL by M.L. Wang CCNU Wuhan & Subatech Oct-23-2009
// --- Root header files ---
#include <TObjArray.h>
AliEMCALEMCGeometry::AliEMCALEMCGeometry()
: TNamed(),
- fGeoName(0),fArrayOpts(0),fNAdditionalOpts(0),fECPbRadThickness(0.),fECScintThick(0.),
+ fGeoName(0),fEMCSMSystem(0x0),fArrayOpts(0),fNAdditionalOpts(0),fECPbRadThickness(0.),fECScintThick(0.),
fNECLayers(0),fArm1PhiMin(0.),fArm1PhiMax(0.),fArm1EtaMin(0.),fArm1EtaMax(0.),fIPDistance(0.),
- fShellThickness(0.),fZLength(0.),fNZ(0),fNPhi(0),fSampling(0.),fNumberOfSuperModules(0),
+ fShellThickness(0.),fZLength(0.),fDCALInnerEdge(0.),fDCALPhiMin(0),fDCALPhiMax(0),fEMCALPhiMax(0),
+ fDCALStandardPhiMax(0),fDCALInnerExtandedEta(0),fNZ(0),fNPhi(0),fSampling(0.),fNumberOfSuperModules(0),
fFrontSteelStrip(0.),fLateralSteelStrip(0.),fPassiveScintThick(0.),fPhiModuleSize(0.),
- fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fLongModuleSize(0.),fNPhiSuperModule(0),
+ fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fLongModuleSize(0.),fPhiSuperModule(0),fNPhiSuperModule(0),
fNPHIdiv(0),fNETAdiv(0), fNCells(0),fNCellsInSupMod(0),fNCellsInModule(0),
// Trigger staff
- fNTRUEta(0), fNTRUPhi(0), fNModulesInTRUEta(0), fNModulesInTRUPhi(0), fNEtaSubOfTRU(0),
+ fNTRUEta(0), fNTRUPhi(0), fNModulesInTRUEta(0), fNModulesInTRUPhi(0), fNEtaSubOfTRU(0), fNTotalTRU(0),
//
- fTrd1Angle(0.),f2Trd1Dx2(0.),
- fPhiGapForSM(0.),fKey110DEG(0),fPhiBoundariesOfSM(0), fPhiCentersOfSM(0),fEtaMaxOfTRD1(0),
- fTrd1AlFrontThick(0.0), fTrd1BondPaperThick(0.),
+ fTrd1Angle(0.),f2Trd1Dx2(0.),fPhiGapForSM(0.),fKey110DEG(0),fnSupModInDCAL(0),fPhiBoundariesOfSM(0),
+ fPhiCentersOfSM(0),fPhiCentersOfSMSec(0),fEtaMaxOfTRD1(0),fTrd1AlFrontThick(0.0), fTrd1BondPaperThick(0.),
fCentersOfCellsEtaDir(0), fCentersOfCellsXDir(0),fCentersOfCellsPhiDir(0),
fEtaCentersOfCells(0),fPhiCentersOfCells(0),fShishKebabTrd1Modules(0),
fParSM(), fILOSS(-1), fIHADR(-1),
AliEMCALEMCGeometry::AliEMCALEMCGeometry(const Text_t* name, const Text_t* title,
const Text_t* mcname, const Text_t* mctitle ) :
TNamed(name,title),
- fGeoName(0),fArrayOpts(0),fNAdditionalOpts(0),fECPbRadThickness(0.),fECScintThick(0.),
+ fGeoName(0),fEMCSMSystem(0x0),fArrayOpts(0),fNAdditionalOpts(0),fECPbRadThickness(0.),fECScintThick(0.),
fNECLayers(0),fArm1PhiMin(0.),fArm1PhiMax(0.),fArm1EtaMin(0.),fArm1EtaMax(0.),fIPDistance(0.),
- fShellThickness(0.),fZLength(0.),fNZ(0),fNPhi(0),fSampling(0.),fNumberOfSuperModules(0),
+ fShellThickness(0.),fZLength(0.),fDCALInnerEdge(0.),fDCALPhiMin(0),fDCALPhiMax(0),fEMCALPhiMax(0),
+ fDCALStandardPhiMax(0),fDCALInnerExtandedEta(0),fNZ(0),fNPhi(0),fSampling(0.),fNumberOfSuperModules(0),
fFrontSteelStrip(0.),fLateralSteelStrip(0.),fPassiveScintThick(0.),fPhiModuleSize(0.),
- fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fLongModuleSize(0.),fNPhiSuperModule(0),
+ fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fLongModuleSize(0.),fPhiSuperModule(0),fNPhiSuperModule(0),
fNPHIdiv(0),fNETAdiv(0), fNCells(0),fNCellsInSupMod(0),fNCellsInModule(0),
// Trigger staff
- fNTRUEta(0), fNTRUPhi(0), fNModulesInTRUEta(0), fNModulesInTRUPhi(0), fNEtaSubOfTRU(0),
+ fNTRUEta(0), fNTRUPhi(0), fNModulesInTRUEta(0), fNModulesInTRUPhi(0), fNEtaSubOfTRU(0), fNTotalTRU(0),
//
- fTrd1Angle(0.),f2Trd1Dx2(0.),
- fPhiGapForSM(0.),fKey110DEG(0),fPhiBoundariesOfSM(0), fPhiCentersOfSM(0), fEtaMaxOfTRD1(0),
- fTrd1AlFrontThick(0.0), fTrd1BondPaperThick(0.),
+ fTrd1Angle(0.),f2Trd1Dx2(0.),fPhiGapForSM(0.),fKey110DEG(0),fnSupModInDCAL(0),fPhiBoundariesOfSM(0),
+ fPhiCentersOfSM(0),fPhiCentersOfSMSec(0),fEtaMaxOfTRD1(0),fTrd1AlFrontThick(0.0), fTrd1BondPaperThick(0.),
fCentersOfCellsEtaDir(0),fCentersOfCellsXDir(0),fCentersOfCellsPhiDir(0),
fEtaCentersOfCells(0),fPhiCentersOfCells(0),fShishKebabTrd1Modules(0),
fParSM(),fILOSS(-1), fIHADR(-1),
AliEMCALEMCGeometry::AliEMCALEMCGeometry(const AliEMCALEMCGeometry& geom)
: TNamed(geom),
fGeoName(geom.fGeoName),
+ fEMCSMSystem(geom.fEMCSMSystem),
fArrayOpts(geom.fArrayOpts),
fNAdditionalOpts(geom.fNAdditionalOpts),
fECPbRadThickness(geom.fECPbRadThickness),
fIPDistance(geom.fIPDistance),
fShellThickness(geom.fShellThickness),
fZLength(geom.fZLength),
+ fDCALInnerEdge(geom.fDCALInnerEdge),
+ fDCALPhiMin(geom.fDCALPhiMin),
+ fDCALPhiMax(geom.fDCALPhiMax),
+ fEMCALPhiMax(geom.fEMCALPhiMax),
+ fDCALStandardPhiMax(geom.fDCALStandardPhiMax),
+ fDCALInnerExtandedEta(geom.fDCALInnerExtandedEta),
fNZ(geom.fNZ),
fNPhi(geom.fNPhi),
fSampling(geom.fSampling),
fPhiTileSize(geom.fPhiTileSize),
fEtaTileSize(geom.fEtaTileSize),
fLongModuleSize(geom.fLongModuleSize),
+ fPhiSuperModule(geom.fPhiSuperModule),
fNPhiSuperModule(geom.fNPhiSuperModule),
fNPHIdiv(geom.fNPHIdiv),
fNETAdiv(geom.fNETAdiv),
fNModulesInTRUEta(geom.fNModulesInTRUEta),
fNModulesInTRUPhi(geom.fNModulesInTRUPhi),
fNEtaSubOfTRU(geom.fNEtaSubOfTRU),
+ fNTotalTRU(geom.fNTotalTRU),
//
fTrd1Angle(geom.fTrd1Angle),
f2Trd1Dx2(geom.f2Trd1Dx2),
fPhiGapForSM(geom.fPhiGapForSM),
fKey110DEG(geom.fKey110DEG),
+ fnSupModInDCAL(geom.fnSupModInDCAL),
fPhiBoundariesOfSM(geom.fPhiBoundariesOfSM),
fPhiCentersOfSM(geom.fPhiCentersOfSM),
+ fPhiCentersOfSMSec(geom.fPhiCentersOfSMSec),
fEtaMaxOfTRD1(geom.fEtaMaxOfTRD1),
fTrd1AlFrontThick(geom.fTrd1AlFrontThick),
fTrd1BondPaperThick(geom.fTrd1BondPaperThick),
//______________________________________________________________________
AliEMCALEMCGeometry::~AliEMCALEMCGeometry(void){
// dtor
+ delete fEMCSMSystem;
}
//______________________________________________________________________
if(fGeoName.Contains("WSUC")) fGeoName = "EMCAL_WSUC";
//check that we have a valid geometry name
- if(!( fGeoName.Contains("EMCAL_PDC06") || fGeoName.Contains("EMCAL_WSUC")
- || fGeoName.Contains("EMCAL_COMPLETE") || fGeoName.Contains("EMCAL_COMPLETEV1") || fGeoName.Contains("EMCAL_COMPLETE12SMV1")
- || fGeoName.Contains("EMCAL_FIRSTYEAR") || fGeoName.Contains("EMCAL_FIRSTYEARV1") )) {
+ if(!( fGeoName.Contains("EMCAL_PDC06")
+ || fGeoName.Contains("EMCAL_WSUC")
+ || fGeoName.Contains("EMCAL_COMPLETE")
+ || fGeoName.Contains("EMCAL_COMPLETEV1")
+ || fGeoName.Contains("EMCAL_COMPLETE12SMV1")
+ || fGeoName.Contains("EMCAL_FIRSTYEAR")
+ || fGeoName.Contains("EMCAL_FIRSTYEARV1") )) {
Fatal("Init", "%s is an undefined geometry!", fGeoName.Data()) ;
}
// Option to know whether we have the "half" supermodule(s) or not
fKey110DEG = 0;
- if(fGeoName.Contains("COMPLETE") || fGeoName.Contains("PDC06") || fGeoName.Contains("12SM")) fKey110DEG = 1; // for GetAbsCellId
+ if( fGeoName.Contains("COMPLETE")
+ || fGeoName.Contains("PDC06")
+ || fGeoName.Contains("12SM")) fKey110DEG = 1; // for GetAbsCellId
if(fGeoName.Contains("COMPLETEV1")) fKey110DEG = 0;
fShishKebabTrd1Modules = 0;
+ fnSupModInDCAL = 0;
+ if(fGeoName.Contains("DCAL_DEV")){
+ fnSupModInDCAL = 10;
+ } else if(fGeoName.Contains("DCAL_8SM")){
+ fnSupModInDCAL = 8;
+ } else if(fGeoName.Contains("DCAL")){
+ fnSupModInDCAL = 6;
+ }
+
// JLK 13-Apr-2008
//default parameters are those of EMCAL_COMPLETE geometry
//all others render variations from these at the end of
//geometry-name specific options
fNumberOfSuperModules = 12; // 12 = 6 * 2 (6 in phi, 2 in Z)
- fNPhi = 12; // module granularity in phi within smod (azimuth)
+ fNPhi = 12; // module granularity in phi within smod (azimuth)
fNZ = 24; // module granularity along Z within smod (eta)
fNPHIdiv = fNETAdiv = 2; // tower granularity within module
fArm1PhiMin = 80.0; // degrees, Starting EMCAL Phi position
fEtaModuleSize = fPhiModuleSize;
fZLength = 700.; // Z coverage (cm)
-
+ fPhiSuperModule = 20. ; // phi in degree
+ fDCALInnerEdge = fIPDistance * TMath::Tan( fTrd1Angle * 8.* TMath::DegToRad());
//needs to be called for each geometry and before setting geometry
//parameters which can depend on the outcome
//In 2009-2010 data taking runs only 4 SM, in the upper position.
if(fGeoName.Contains("FIRSTYEAR")){
fNumberOfSuperModules = 4;
- fArm1PhiMax = 120.0;
+ fArm1PhiMax = 120.0;
CheckAdditionalOptions();
- }
+ }
if(fGeoName.Contains("FIRSTYEARV1") || fGeoName.Contains("COMPLETEV1") || fGeoName.Contains("COMPLETE12SMV1") ){
// Oct 26,2010 : First module has tilt = 0.75 degree :
if(fGeoName.Contains("COMPLETEV1"))
{
fNumberOfSuperModules = 10;
- fArm1PhiMax = 180.0;
+ fArm1PhiMax = 180.0;
}
else if (fGeoName.Contains("COMPLETE12SMV1"))
{
fNumberOfSuperModules = 12;
fArm1PhiMax = 200.0;
}
+ if (fGeoName.Contains("DCAL"))
+ {
+ fNumberOfSuperModules = 12 + fnSupModInDCAL;
+ fArm1PhiMax = 320.0;
+ if(fGeoName.Contains("DCAL_8SM")) fArm1PhiMax = 340.0; // degrees, End of DCAL Phi position
+ else if(fGeoName.Contains("DCAL_DEV")) fArm1PhiMin = 40.0; // degrees, Starting EMCAL(shifted) Phi position
+ fDCALPhiMin = fArm1PhiMax - 10.*fnSupModInDCAL;
+ }
CheckAdditionalOptions();
}
+ fEMCSMSystem = new Int_t[fNumberOfSuperModules];
+ Int_t iSM = 0;
+
+ // BASIC EMCAL SM
+ if(fGeoName.Contains("WSUC") ){
+ for(int i = 0; i<2; i++){
+ fEMCSMSystem[iSM] = kEMCAL_Standard;
+ iSM++;
+ }
+ } else if(fGeoName.Contains("FIRSTYEAR") ){
+ for(int i = 0; i<4; i++){
+ fEMCSMSystem[iSM] = kEMCAL_Standard;
+ iSM++;
+ }
+ } else if( fGeoName.Contains("PDC06")
+ || fGeoName.Contains("COMPLETE") ){
+ for(int i = 0; i<10; i++){
+ fEMCSMSystem[iSM] = kEMCAL_Standard;
+ iSM++;
+ }
+ }
+ // EMCAL 110SM
+ if(fKey110DEG && fGeoName.Contains("12SM") ){
+ for(int i = 0; i<2; i++){
+ fEMCSMSystem[iSM] = kEMCAL_Half;
+ if(fGeoName.Contains("12SMV1") ){
+ fEMCSMSystem[iSM] = kEMCAL_3rd;
+ }
+ iSM++;
+ }
+ }
+ // DCAL SM
+ if(fnSupModInDCAL && fGeoName.Contains("DCAL")){
+ if(fGeoName.Contains("8SM")) {
+ for(int i = 0; i<fnSupModInDCAL-2; i++){
+ fEMCSMSystem[iSM] = kDCAL_Standard;
+ iSM++;
+ }
+ for(int i = 0; i<2; i++){
+ fEMCSMSystem[iSM] = kDCAL_Ext;
+ iSM++;
+ }
+ } else {
+ for(int i = 0; i<fnSupModInDCAL; i++){
+ fEMCSMSystem[iSM] = kDCAL_Standard;
+ iSM++;
+ }
+ }
+ }
+
// constant for transition absid <--> indexes
fNCellsInModule = fNPHIdiv*fNETAdiv;
fNCellsInSupMod = fNCellsInModule*fNPhi*fNZ;
- fNCells = fNCellsInSupMod*fNumberOfSuperModules;
- if(GetKey110DEG() && !fGeoName.Contains("12SMV1")) fNCells -= fNCellsInSupMod; // SM 10 and 11 are 1/2 size on phi
- if(GetKey110DEG() && fGeoName.Contains("12SMV1") ) fNCells -=2*(2 * fNCellsInSupMod / 3); // SM 10 and 11 are 1/3 size on phi
+ fNCells = 0;
+ for( int i=0; i<fNumberOfSuperModules; i++) {
+ if( GetSMType(i) == kEMCAL_Standard) fNCells += fNCellsInSupMod ;
+ else if( GetSMType(i) == kEMCAL_Half) fNCells += fNCellsInSupMod/2 ;
+ else if( GetSMType(i) == kEMCAL_3rd) fNCells += fNCellsInSupMod/3 ;
+ else if( GetSMType(i) == kDCAL_Standard) fNCells += 2*fNCellsInSupMod/3 ;
+ else if( GetSMType(i) == kDCAL_Ext) fNCells += fNCellsInSupMod/3 ;
+ else AliError(Form("Uknown SuperModule Type !!"));
+ }
fNPhiSuperModule = fNumberOfSuperModules/2;
if(fNPhiSuperModule < 1) fNPhiSuperModule = 1;
fParSM[1] = GetPhiModuleSize() * GetNPhi()/2.;
fParSM[2] = fZLength/4.; //divide by 4 to get half-length of SM
- // SM phi boundaries - (0,1),(2,3) .. (10,11) - has the same boundaries; Nov 7, 2006
+ // SM phi boundaries - (0,1),(2,3) ... - has the same boundaries;
fPhiBoundariesOfSM.Set(fNumberOfSuperModules);
fPhiCentersOfSM.Set(fNumberOfSuperModules/2);
- fPhiBoundariesOfSM[0] = TMath::PiOver2() - TMath::ATan2(fParSM[1] , fIPDistance); // 1th and 2th modules)
- fPhiCentersOfSM[0] = TMath::PiOver2();
- if(fNumberOfSuperModules > 1)
- fPhiBoundariesOfSM[1] = TMath::PiOver2() + TMath::ATan2(fParSM[1] , fIPDistance);
- if(fNumberOfSuperModules > 2) {
- Int_t maxPhiBlock =fNumberOfSuperModules/2-1;
- if(fNumberOfSuperModules > 10) maxPhiBlock = 4;
- for(int i=1; i<=maxPhiBlock; i++) { // from 2th ro 9th
- fPhiBoundariesOfSM[2*i] = fPhiBoundariesOfSM[0] + 20.*TMath::DegToRad()*i;
- fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[1] + 20.*TMath::DegToRad()*i;
- fPhiCentersOfSM[i] = fPhiCentersOfSM[0] + 20.*TMath::DegToRad()*i;
+ fPhiCentersOfSMSec.Set(fNumberOfSuperModules/2);
+ Double_t kfSupermodulePhiWidth = fPhiSuperModule*TMath::DegToRad();
+ fPhiCentersOfSM[0] = (fArm1PhiMin + fPhiSuperModule/2.) * TMath::DegToRad(); // Define from First SM
+ fPhiCentersOfSMSec[0] = fPhiCentersOfSM[0]; // the same in the First SM
+ fPhiBoundariesOfSM[0] = fPhiCentersOfSM[0] - TMath::ATan2(fParSM[1] , fIPDistance); // 1th and 2th modules)
+ fPhiBoundariesOfSM[1] = fPhiCentersOfSM[0] + TMath::ATan2(fParSM[1] , fIPDistance);
+ if(fNumberOfSuperModules > 2) { // 2 to Max
+ Int_t tmpSMType = GetSMType(2);
+ for(int i = 1; i<fNPhiSuperModule; i++) {
+ fPhiBoundariesOfSM[2*i] += fPhiBoundariesOfSM[2*i-2] + kfSupermodulePhiWidth;
+ if(tmpSMType == GetSMType(2*i)) {
+ fPhiBoundariesOfSM[2*i+1] += fPhiBoundariesOfSM[2*i-1] + kfSupermodulePhiWidth;
+ } else {
+ //changed SM Type, redefine the [2*i+1] Boundaries
+ tmpSMType = GetSMType(2*i);
+ if( GetSMType(2*i) == kEMCAL_Standard) {
+ fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[2*i] + kfSupermodulePhiWidth;
+ } else if( GetSMType(2*i) == kEMCAL_Half) {
+ fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[2*i] + 2.*TMath::ATan2((fParSM[1])/2, fIPDistance);
+ } else if( GetSMType(2*i) == kEMCAL_3rd ) {
+ fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[2*i] + 2.*TMath::ATan2((fParSM[1])/3, fIPDistance);
+ } else if( GetSMType(2*i) == kDCAL_Standard ) { // jump the gap
+ fPhiBoundariesOfSM[2*i] = (fDCALPhiMin - fArm1PhiMin)*TMath::DegToRad() + fPhiBoundariesOfSM[0];
+ fPhiBoundariesOfSM[2*i+1] = (fDCALPhiMin - fArm1PhiMin)*TMath::DegToRad() + fPhiBoundariesOfSM[1];
+ } else if( GetSMType(2*i) == kDCAL_Ext) {
+ fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[2*i] + 2.*TMath::ATan2((fParSM[1])/3, fIPDistance);
+ }
+ }
+ fPhiCentersOfSM[i] = (fPhiBoundariesOfSM[2*i]+fPhiBoundariesOfSM[2*i+1])/2.;
+ fPhiCentersOfSMSec[i] = fPhiBoundariesOfSM[2*i] + TMath::ATan2(fParSM[1] , fIPDistance);
}
}
- if(fNumberOfSuperModules > 10) {
- fPhiBoundariesOfSM[10] = fPhiBoundariesOfSM[0] + 20.*TMath::DegToRad()*5; // in the ideal case the phi-gap is constant
- fPhiBoundariesOfSM[11] = fPhiBoundariesOfSM[10] + 2.*TMath::ATan2((fParSM[1])/3., fIPDistance); // one_third SMs
- fPhiCentersOfSM[5] = (fPhiBoundariesOfSM[10]+fPhiBoundariesOfSM[11])/2.;
- }
+ //inner extend in eta (same as outer part) for DCal (0.189917), //calculated from the smallest gap (1# cell to the 80-degree-edge),
+ Double_t fInnerExtandedPhi = 1.102840997; //calculated from the smallest gap (1# cell to the 80-degree-edge), too complicatd to explain...
+ fDCALInnerExtandedEta = -TMath::Log(TMath::Tan( (TMath::Pi()/2. - 8*fTrd1Angle*TMath::DegToRad() + (TMath::Pi()/2 - fNZ*fTrd1Angle*TMath::DegToRad() - TMath::ATan(TMath::Exp(fArm1EtaMin))*2))/2.));
+
+ fEMCALPhiMax = fArm1PhiMin;
+ fDCALPhiMax = fDCALPhiMin;// DCAl extention will not be included
+ for( Int_t i = 0; i < fNumberOfSuperModules; i+=2) {
+ if( GetSMType(i) == kEMCAL_Standard ) fEMCALPhiMax += 20.;
+ else if( GetSMType(i) == kEMCAL_Half ) fEMCALPhiMax += fPhiSuperModule/2. + fInnerExtandedPhi;
+ else if( GetSMType(i) == kEMCAL_3rd ) fEMCALPhiMax += fPhiSuperModule/3. + 4.0*fInnerExtandedPhi/3.0;
+ else if( GetSMType(i) == kDCAL_Standard ) {fDCALPhiMax += 20.; fDCALStandardPhiMax = fDCALPhiMax;}
+ else if( GetSMType(i) == kDCAL_Ext ) fDCALPhiMax += fPhiSuperModule/3. + 4.0*fInnerExtandedPhi/3.0;
+ else AliError("Unkown SM Type!!");
+ }
+// for compatible reason
+// if(fNumberOfSuperModules == 4) {fEMCALPhiMax = fArm1PhiMax ;}
+ if(fNumberOfSuperModules == 12) {fEMCALPhiMax = fArm1PhiMax ;}
+
//called after setting of scintillator and lead layer parameters
DefineSamplingFraction(mcname,mctitle);
// 3*6*10 + 2*6*2 = 204 -> matrix (nphi(17), neta(12))
fNEtaSubOfTRU = 6;
+ fNTotalTRU = 0;
+ for(Int_t i = 0; i < GetNumberOfSuperModules(); i++){
+ if( GetSMType(i) == kEMCAL_Standard) fNTotalTRU += 3;
+ else if( GetSMType(i) == kEMCAL_Half) fNTotalTRU += 1;
+ else if( GetSMType(i) == kEMCAL_3rd) fNTotalTRU += 1;
+ else if( GetSMType(i) == kDCAL_Standard) fNTotalTRU += 3;
+ else if( GetSMType(i) == kDCAL_Ext) fNTotalTRU += 1;
+ else {
+ AliError(Form("Uknown SuperModule Type !!"));
+ }
+ }
+
fgInit = kTRUE;
}
printf(" %i : %s \n", i, o->String().Data());
}
}
+ if(fGeoName.Contains("DCAL")) {
+ printf("Phi min of DCAL SuperModule: %7.1f, DCAL has %d SuperModule\n", fDCALPhiMin, fnSupModInDCAL);
+ printf("The DCAL inner edge is +- %7.1f\n", fDCALInnerEdge);
+ if(fGeoName.Contains("DCAL_8SM")) printf("DCAL has its 2 EXTENTION SM\n");
+ }
printf("Granularity: %d in eta and %d in phi\n", GetNZ(), GetNPhi()) ;
printf("Layout: phi = (%7.1f, %7.1f), eta = (%5.2f, %5.2f), IP = %7.2f -> for EMCAL envelope only\n",
GetArm1PhiMin(), GetArm1PhiMax(),GetArm1EtaMin(), GetArm1EtaMax(), GetIPDistance() );
printf(" #of sampling layers %i(fNECLayers) \n", fNECLayers);
printf(" fLongModuleSize %6.3f cm \n", fLongModuleSize);
printf(" #supermodule in phi direction %i \n", fNPhiSuperModule );
+ printf(" supermodule width in phi direction %f \n", fPhiSuperModule );
printf(" fILOSS %i : fIHADR %i \n", fILOSS, fIHADR);
printf(" fTrd1Angle %7.4f\n", fTrd1Angle);
printf(" f2Trd1Dx2 %7.4f\n", f2Trd1Dx2);
fParSM[0],fParSM[1],fParSM[2]);
printf(" fPhiGapForSM %7.4f cm (%7.4f <- phi size in degree)\n",
fPhiGapForSM, TMath::ATan2(fPhiGapForSM,fIPDistance)*TMath::RadToDeg());
- if(GetKey110DEG() && !fGeoName.Contains("12SMV1") ) printf(" Last two modules have size 10 degree in phi (180<phi<190)\n");
- if(GetKey110DEG() && fGeoName.Contains("12SMV1")) printf(" Last two modules have size 6.6 degree in phi (180<phi<186.6)\n");
+ if( fKey110DEG && !fGeoName.Contains("12SMV1") ) printf(" Last two modules have size 10 degree in phi (180<phi<190)\n");
+ if( fKey110DEG && fGeoName.Contains("12SMV1")) printf(" Last two modules have size 6.6 degree in phi (180<phi<186.6)\n");
printf(" phi SM boundaries \n");
for(int i=0; i<fPhiBoundariesOfSM.GetSize()/2.; i++) {
- printf(" %i : %7.5f(%7.2f) -> %7.5f(%7.2f) : center %7.5f(%7.2f) \n", i,
+ printf(" %i : %7.15f(%7.12f) -> %7.15f(%7.12f) : center %7.15f(%7.12f) \n", i,
fPhiBoundariesOfSM[2*i], fPhiBoundariesOfSM[2*i]*TMath::RadToDeg(),
fPhiBoundariesOfSM[2*i+1], fPhiBoundariesOfSM[2*i+1]*TMath::RadToDeg(),
fPhiCentersOfSM[i], fPhiCentersOfSM[i]*TMath::RadToDeg());
}
+//________________________________________________________________________________________________
+Double_t AliEMCALEMCGeometry::GetPhiCenterOfSMSec(Int_t nsupmod) const
+{
+ //returns center of supermodule in phi
+ int i = nsupmod/2;
+ return fPhiCentersOfSMSec[i];
+
+}
+
//________________________________________________________________________________________________
Double_t AliEMCALEMCGeometry::GetPhiCenterOfSM(Int_t nsupmod) const
{
//________________________________________________________________________________________________
Bool_t AliEMCALEMCGeometry::GetPhiBoundariesOfSM(Int_t nSupMod, Double_t &phiMin, Double_t &phiMax) const
{
- // 0<= nSupMod <=11; phi in rad
- static int i;
- if(nSupMod<0 || nSupMod >11) return kFALSE;
+ // 0<= nSupMod <=17; phi in rad
+ static int i;
+ if(nSupMod<0 || nSupMod >12+fnSupModInDCAL-1) return kFALSE;
i = nSupMod/2;
phiMin = (Double_t)fPhiBoundariesOfSM[2*i];
phiMax = (Double_t)fPhiBoundariesOfSM[2*i+1];
//________________________________________________________________________________________________
Bool_t AliEMCALEMCGeometry::GetPhiBoundariesOfSMGap(Int_t nPhiSec, Double_t &phiMin, Double_t &phiMax) const
{
- // 0<= nPhiSec <=4; phi in rad
+ // 0<= nPhiSec <=max; phi in rad
// 0; gap boundaries between 0th&2th | 1th&3th SM
// 1; gap boundaries between 2th&4th | 3th&5th SM
// 2; gap boundaries between 4th&6th | 5th&7th SM
// 3; gap boundaries between 6th&8th | 7th&9th SM
// 4; gap boundaries between 8th&10th | 9th&11th SM
- if(nPhiSec<0 || nPhiSec >4) return kFALSE;
+ // 5; gap boundaries between 10th&12th | 11h&13th SM
+ // ...
+ if(nPhiSec<0 || nPhiSec >5+fnSupModInDCAL/2-1) return kFALSE;
phiMin = fPhiBoundariesOfSM[2*nPhiSec+1];
phiMax = fPhiBoundariesOfSM[2*nPhiSec+2];
return kTRUE;
//*-- and : Aleksei Pavlinov (WSU) - shashlyk staff
//*-- and : Gustavo Conesa: Add TRU mapping. TRU parameters still not fixed.
//*-- and : Magali Estienne (Subatech): class added for new library for EMCALGeoUtils.par file
+//*-- and : Adapted for DCAL by M.L. Wang CCNU Wuhan & Subatech Oct-23-2009
// --- ROOT system ---
#include <TMath.h>
class AliEMCALEMCGeometry : public TNamed {
public:
+ enum fEMCSMType { kEMCAL_Standard = 0, kEMCAL_Half = 1, kEMCAL_3rd = 2, kDCAL_Standard = 3, kDCAL_Ext= 4 }; // possible SM Type
AliEMCALEMCGeometry(); // default ctor only for internal usage (singleton)
AliEMCALEMCGeometry(const AliEMCALEMCGeometry& geom);
// ctor only for internal usage (singleton)
void Init(const Text_t* mcname="", const Text_t* mctitle=""); // initializes the parameters of EMCAL
void CheckAdditionalOptions(); //
- void DefineSamplingFraction(const Text_t* mcname="", const Text_t* mctitle="");
+ void DefineSamplingFraction(const Text_t* mcname="", const Text_t* mctitle="");
//////////////////////////////////////
// Return EMCAL geometrical parameters
//
TString GetGeoName() const {return fGeoName;}
+ Int_t * GetEMCSystem() const {return fEMCSMSystem;}
const Char_t* GetNameOfEMCALEnvelope() const { const Char_t* env = "XEN1"; return env ;}
Float_t GetArm1PhiMin() const { return fArm1PhiMin ; }
Float_t GetArm1PhiMax() const { return fArm1PhiMax ; }
Float_t GetArm1EtaMin() const { return fArm1EtaMin;}
Float_t GetArm1EtaMax() const { return fArm1EtaMax;}
- Float_t GetIPDistance() const { return fIPDistance;}
- Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }
+ Float_t GetIPDistance() const { return fIPDistance;}
+ Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; }
Float_t GetShellThickness() const { return fShellThickness ; }
- Float_t GetZLength() const { return fZLength ; }
+ Float_t GetZLength() const { return fZLength ; }
+ Float_t GetDCALInnerEdge() const { return fDCALInnerEdge ; }
+ Float_t GetDCALPhiMin() const { return fDCALPhiMin ; }
+ Float_t GetDCALPhiMax() const { return fDCALPhiMax ; }
+ Float_t GetDCALInnerExtandedEta() const { return fDCALInnerExtandedEta ; }
+ Float_t GetEMCALPhiMax() const { return fEMCALPhiMax ; }
+ Float_t GetDCALStandardPhiMax() const { return fDCALStandardPhiMax ; }
Int_t GetNECLayers() const {return fNECLayers ;}
Int_t GetNZ() const {return fNZ ;}
Int_t GetNEta() const {return fNZ ;}
Int_t GetNPhi() const {return fNPhi ;}
Float_t GetECPbRadThick()const {return fECPbRadThickness;}
Float_t GetECScintThick() const {return fECScintThick;}
- Float_t GetSampling() const {return fSampling ; }
+ Float_t GetSampling() const {return fSampling ; }
Int_t GetNumberOfSuperModules() const {return fNumberOfSuperModules;}
- Float_t GetfPhiGapForSuperModules() const {return fPhiGapForSM;}
+ Float_t GetPhiGapForSuperModules() const {return fPhiGapForSM;}
Float_t GetPhiModuleSize() const {return fPhiModuleSize;}
Float_t GetEtaModuleSize() const {return fEtaModuleSize;}
Float_t GetFrontSteelStrip() const {return fFrontSteelStrip;}
Float_t GetPassiveScintThick() const {return fPassiveScintThick;}
Float_t GetPhiTileSize() const {return fPhiTileSize;}
Float_t GetEtaTileSize() const {return fEtaTileSize;}
+ Float_t GetPhiSuperModule() const {return fPhiSuperModule;}
Int_t GetNPhiSuperModule() const {return fNPhiSuperModule;}
Int_t GetNPHIdiv() const {return fNPHIdiv ;}
Int_t GetNETAdiv() const {return fNETAdiv ;}
Int_t GetNCellsInSupMod() const {return fNCellsInSupMod;}
Int_t GetNCellsInModule() const {return fNCellsInModule; }
Int_t GetKey110DEG() const {return fKey110DEG;}
+ Int_t GetnSupModInDCAL() const {return fnSupModInDCAL;}
Int_t GetILOSS() const {return fILOSS;}
Int_t GetIHADR() const {return fIHADR;}
// For gamma(Jet) trigger simulations
Int_t GetNTRUEta() const {return fNTRUEta ; }
Int_t GetNTRUPhi() const {return fNTRUPhi ; }
Int_t GetNEtaSubOfTRU() const {return fNEtaSubOfTRU;}
+ Int_t GetNTotalTRU() const {return fNTotalTRU ; }
Int_t GetNModulesInTRU() const {return fNModulesInTRUEta*fNModulesInTRUPhi; }
Int_t GetNModulesInTRUEta() const {return fNModulesInTRUEta ; }
Int_t GetNModulesInTRUPhi() const {return fNModulesInTRUPhi ; }
// --
- Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/ ((Float_t)fNZ);}
- Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/ ((Float_t)fNPhi);}
- Int_t GetNTowers() const {return fNPhi * fNZ ;}
+ Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/ ((Float_t)fNZ);}
+ Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/ ((Float_t)fNPhi);}
+ Int_t GetNTowers() const {return fNPhi * fNZ ;}
//
Double_t GetPhiCenterOfSM(Int_t nsupmod) const;
- Float_t GetSuperModulesPar(Int_t ipar) const {return fParSM[ipar];}
+ Double_t GetPhiCenterOfSMSec(Int_t nsupmod) const;
+ Float_t GetSuperModulesPar(Int_t ipar) const {return fParSM[ipar];}
+ Int_t GetSMType(Int_t nSupMod) const { if( nSupMod > GetNumberOfSuperModules() ) return -1;
+ return fEMCSMSystem[nSupMod] ; }
//
Bool_t GetPhiBoundariesOfSM (Int_t nSupMod, Double_t &phiMin, Double_t &phiMax) const;
Bool_t GetPhiBoundariesOfSMGap(Int_t nPhiSec, Double_t &phiMin, Double_t &phiMax) const;
void SetNPhi(Int_t nphi) { fNPhi= nphi;
printf("SetNPhi: Number of modules in Phi set to %d", fNPhi) ; }
void SetNTRUEta(Int_t ntru) {fNTRUEta = ntru;
- printf("SetNTRU: Number of TRUs per SuperModule in Etaset to %d", fNTRUEta) ;}
+ printf("SetNTRU: Number of TRUs per SuperModule in Eta set to %d", fNTRUEta) ;}
void SetNTRUPhi(Int_t ntru) {fNTRUPhi = ntru;
printf("SetNTRU: Number of TRUs per SuperModule in Phi set to %d", fNTRUPhi) ;}
void SetSampling(Float_t samp) { fSampling = samp;
// Member data
TString fGeoName; //geometry name
+ Int_t *fEMCSMSystem; // geometry structure
TObjArray *fArrayOpts; //! array of geometry options
const char *fkAdditionalOpts[6]; //! some additional options for the geometry type and name
Float_t fIPDistance; // Radial Distance of the inner surface of the EMCAL
Float_t fShellThickness; // Total thickness in (x,y) direction
Float_t fZLength; // Total length in z direction
+ Float_t fDCALInnerEdge; // Inner edge for DCAL
+ Float_t fDCALPhiMin; // Minimum angular position of DCAL in Phi (degrees)
+ Float_t fDCALPhiMax; // Maximum angular position of DCAL in Phi (degrees)
+ Float_t fEMCALPhiMax; // Maximum angular position of EMCAL in Phi (degrees)
+ Float_t fDCALStandardPhiMax; // special edge for the case that DCAL contian extension
+ Float_t fDCALInnerExtandedEta; // DCAL inner edge in Eta (with some extension)
Int_t fNZ; // Number of Towers in the Z direction
Int_t fNPhi; // Number of Towers in the PHI direction
Float_t fSampling; // Sampling factor
Float_t fPhiTileSize; // Size of phi tile
Float_t fEtaTileSize; // Size of eta tile
Float_t fLongModuleSize; // Size of long module
- Int_t fNPhiSuperModule; // 6 - number supermodule in phi direction
+ Float_t fPhiSuperModule; // Phi of normal supermodule (20, in degree)
+ Int_t fNPhiSuperModule; // 9 - number supermodule in phi direction
Int_t fNPHIdiv; // number phi divizion of module
Int_t fNETAdiv; // number eta divizion of module
//
Int_t fNModulesInTRUEta; // Number of modules per TRU in eta
Int_t fNModulesInTRUPhi; // Number of modules per TRU in phi
Int_t fNEtaSubOfTRU; // Number of eta (z) subregiohi
+ Int_t fNTotalTRU; // Total Number of TRU (all SM)
// TRD1 options - 30-sep-04
Float_t fTrd1Angle; // angle in x-z plane (in degree)
Float_t f2Trd1Dx2; // 2*dx2 for TRD1
Float_t fPhiGapForSM; // Gap betweeen supermodules in phi direction
Int_t fKey110DEG; // for calculation abs cell id; 19-oct-05
+ Int_t fnSupModInDCAL; // for calculation abs cell id;
TArrayD fPhiBoundariesOfSM; // phi boundaries of SM in rad; size is fNumberOfSuperModules;
- TArrayD fPhiCentersOfSM; // phi of centers of SMl size is fNumberOfSuperModules/2
+ TArrayD fPhiCentersOfSM; // phi of centers of SM; size is fNumberOfSuperModules/2
+ TArrayD fPhiCentersOfSMSec; // phi of centers of section where SM lies; size is fNumberOfSuperModules/2
Float_t fEtaMaxOfTRD1; // max eta in case of TRD1 geometry (see AliEMCALShishKebabTrd1Module)
// Oct 26,2010
Float_t fTrd1AlFrontThick; // Thickness of the Al front plate
///////////////////////////////////////////////////////////
- ClassDef(AliEMCALEMCGeometry, 2) // EMCAL geometry class
+ ClassDef(AliEMCALEMCGeometry, 3) // EMCAL geometry class
};
#endif // AliEMCALEMCGEOMETRY_H
public:
// general geometry info
- static const int fgkEMCALModules = 12; // number of modules for EMCAL
+ static const int fgkEMCALModules = 22; // number of modules, adapted for DCAL
static const int fgkEMCALRows = 24; // number of rows per module for EMCAL
static const int fgkEMCALCols = 48; // number of columns per module for EMCAL
//
// EMCAL_COMPLETE12SMV1: contains 12 SM for runs from year 2012 and on
//
+// EMCAL_COMPLETE12SMV1_DCAL: contains 12 SM and 6 DCAL SM
+//
+// EMCAL_COMPLETE12SMV1_DCAL_8SM: contains 12 SM and 8 DCAL SM including the DCAL extention (2 SM)
+//
+// EMCAL_COMPLETE12SMV1_DCAL_DEV: contains 12 SM shifted and 10 DCAL SM
+//
// EMCAL_WSUC (Wayne State test stand)
// = no definite equivalent in old notation, was only used by
// Aleksei, but kept for testing purposes
// in AliEMCALGeometry
//
// -- Author: Magali Estienne (magali.estienne@subatech.in2p3.fr)
+// and : Adapted for DCAL, M.L. Wang CCNU & Subatech Oct-18-2012
//
//
// Usage:
//____________________________________________________________________________
AliEMCALGeometry::AliEMCALGeometry():
- fEMCGeometry(0x0),fGeoName(0),
- fKey110DEG(0),fNCellsInSupMod(0),fNETAdiv(0),fNPHIdiv(0),
+ fEMCGeometry(0x0),fGeoName(0),fEMCSMSystem(0x0),
+ fKey110DEG(0),fnSupModInDCAL(0),fNCellsInSupMod(0),fNETAdiv(0),fNPHIdiv(0),
fNCellsInModule(0),fPhiBoundariesOfSM(0x0),fPhiCentersOfSM(0x0),
- fPhiCentersOfCells(0x0),fCentersOfCellsEtaDir(0x0),
+ fPhiCentersOfSMSec(0x0),fPhiCentersOfCells(0x0),fCentersOfCellsEtaDir(0x0),
fCentersOfCellsPhiDir(0x0),fEtaCentersOfCells(0x0),
fNCells(0),fNPhi(0),fCentersOfCellsXDir(0x0),fArm1EtaMin(0),
fArm1EtaMax(0),fArm1PhiMin(0),fArm1PhiMax(0),fEtaMaxOfTRD1(0),
- fShishKebabTrd1Modules(0),fPhiModuleSize(0.),
+ fDCALPhiMin(0),fDCALPhiMax(0),fEMCALPhiMax(0),fDCALStandardPhiMax(0),
+ fDCALInnerExtandedEta(0),fShishKebabTrd1Modules(0),fPhiModuleSize(0.),
fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fNZ(0),
fIPDistance(0.),fLongModuleSize(0.),fShellThickness(0.),
fZLength(0.),fSampling(0.),fUseExternalMatrices(kFALSE)
fkSModuleMatrix[i]=0 ;
for (Int_t i = 0; i < 48; i++)
- for (Int_t j = 0; j < 64; j++) fFastOR2DMap[i][j] = -1;
+ for (Int_t j = 0; j < 124; j++) fFastOR2DMap[i][j] = -1;
}
//____________________________________________________________________________
AliEMCALGeometry::AliEMCALGeometry(const AliEMCALGeometry & geo)
: TNamed(geo),
- fEMCGeometry(geo.fEMCGeometry),fGeoName(geo.fGeoName),
- fKey110DEG(geo.fKey110DEG),fNCellsInSupMod(geo.fNCellsInSupMod),fNETAdiv(geo.fNETAdiv),fNPHIdiv(geo.fNPHIdiv),
+ fEMCGeometry(geo.fEMCGeometry),fGeoName(geo.fGeoName),fEMCSMSystem(geo.fEMCSMSystem),
+ fKey110DEG(geo.fKey110DEG),fnSupModInDCAL(geo.fnSupModInDCAL),fNCellsInSupMod(geo.fNCellsInSupMod),fNETAdiv(geo.fNETAdiv),fNPHIdiv(geo.fNPHIdiv),
fNCellsInModule(geo.fNCellsInModule),fPhiBoundariesOfSM(geo.fPhiBoundariesOfSM),fPhiCentersOfSM(geo.fPhiCentersOfSM),
- fPhiCentersOfCells(geo.fPhiCentersOfCells),fCentersOfCellsEtaDir(geo.fCentersOfCellsEtaDir),
+ fPhiCentersOfSMSec(geo.fPhiCentersOfSMSec),fPhiCentersOfCells(geo.fPhiCentersOfCells),fCentersOfCellsEtaDir(geo.fCentersOfCellsEtaDir),
fCentersOfCellsPhiDir(geo.fCentersOfCellsPhiDir),fEtaCentersOfCells(geo.fEtaCentersOfCells),
fNCells(geo.fNCells),fNPhi(geo.fNPhi),fCentersOfCellsXDir(geo.fCentersOfCellsXDir),fArm1EtaMin(geo.fArm1EtaMin),
fArm1EtaMax(geo.fArm1EtaMax),fArm1PhiMin(geo.fArm1PhiMin),fArm1PhiMax(geo.fArm1PhiMax),fEtaMaxOfTRD1(geo.fEtaMaxOfTRD1),
- fShishKebabTrd1Modules(geo.fShishKebabTrd1Modules),fPhiModuleSize(geo.fPhiModuleSize),
+ fDCALPhiMin(geo.fDCALPhiMin),fDCALPhiMax(geo.fDCALPhiMax),fEMCALPhiMax(geo.fEMCALPhiMax),fDCALStandardPhiMax(geo.fDCALStandardPhiMax),
+ fDCALInnerExtandedEta(geo.fDCALInnerExtandedEta),fShishKebabTrd1Modules(geo.fShishKebabTrd1Modules),fPhiModuleSize(geo.fPhiModuleSize),
fEtaModuleSize(geo.fEtaModuleSize),fPhiTileSize(geo.fPhiTileSize),fEtaTileSize(geo.fEtaTileSize),fNZ(geo.fNZ),
fIPDistance(geo.fIPDistance),fLongModuleSize(geo.fLongModuleSize),fShellThickness(geo.fShellThickness),
fZLength(geo.fZLength),fSampling(geo.fSampling),fUseExternalMatrices(geo.fUseExternalMatrices)
fkSModuleMatrix[i]=0 ;
for (Int_t i = 0; i < 48; i++)
- for (Int_t j = 0; j < 64; j++) fFastOR2DMap[i][j] = geo.fFastOR2DMap[i][j];
+ for (Int_t j = 0; j < 124; j++) fFastOR2DMap[i][j] = geo.fFastOR2DMap[i][j];
}
//____________________________________________________________________________
AliEMCALGeometry::AliEMCALGeometry(const Text_t* name, const Text_t* title,
const Text_t* mcname, const Text_t* mctitle)
: TNamed(name, title),
- fEMCGeometry(0x0),fGeoName(0),
- fKey110DEG(0),fNCellsInSupMod(0),fNETAdiv(0),fNPHIdiv(0),
+ fEMCGeometry(0x0),fGeoName(0),fEMCSMSystem(0x0),
+ fKey110DEG(0),fnSupModInDCAL(0),fNCellsInSupMod(0),fNETAdiv(0),fNPHIdiv(0),
fNCellsInModule(0),fPhiBoundariesOfSM(0x0),fPhiCentersOfSM(0x0),
- fPhiCentersOfCells(0x0),fCentersOfCellsEtaDir(0x0),
+ fPhiCentersOfSMSec(0x0),fPhiCentersOfCells(0x0),fCentersOfCellsEtaDir(0x0),
fCentersOfCellsPhiDir(0x0),fEtaCentersOfCells(0x0),
fNCells(0),fNPhi(0),fCentersOfCellsXDir(0x0),fArm1EtaMin(0),
fArm1EtaMax(0),fArm1PhiMin(0),fArm1PhiMax(0),fEtaMaxOfTRD1(0),
- fShishKebabTrd1Modules(0),fPhiModuleSize(0.),
+ fDCALPhiMin(0),fDCALPhiMax(0),fEMCALPhiMax(0),fDCALStandardPhiMax(0),
+ fDCALInnerExtandedEta(0),fShishKebabTrd1Modules(0),fPhiModuleSize(0.),
fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fNZ(0),
fIPDistance(0.),fLongModuleSize(0.),fShellThickness(0.),
fZLength(0.),fSampling(0.), fUseExternalMatrices(kFALSE)
// ctor only for normal usage
fEMCGeometry = new AliEMCALEMCGeometry(name,title,mcname,mctitle);
-
fGeoName = fEMCGeometry->GetGeoName();
+ fEMCSMSystem = fEMCGeometry->GetEMCSystem();
fKey110DEG = fEMCGeometry->GetKey110DEG();
+ fnSupModInDCAL = fEMCGeometry->GetnSupModInDCAL();
fNCellsInSupMod = fEMCGeometry->GetNCellsInSupMod();
fNETAdiv = fEMCGeometry->GetNETAdiv();
fNPHIdiv = fEMCGeometry->GetNPHIdiv();
Int_t nSMod = fEMCGeometry->GetNumberOfSuperModules();
fPhiBoundariesOfSM.Set(nSMod);
fPhiCentersOfSM.Set(nSMod/2);
+ fPhiCentersOfSMSec.Set(nSMod/2);
for(Int_t sm=0; sm<nSMod; sm++) {
i = sm/2;
fEMCGeometry->GetPhiBoundariesOfSM(sm,fPhiBoundariesOfSM[2*i],fPhiBoundariesOfSM[2*i+1]);
fEMCGeometry->GetPhiBoundariesOfSM(sm,phiMin,phiMax);
i=sm/2;
fPhiCentersOfSM[i] = fEMCGeometry->GetPhiCenterOfSM(sm);
+ fPhiCentersOfSMSec[i] = fEMCGeometry->GetPhiCenterOfSMSec(sm);
}
fNCells = fEMCGeometry->GetNCells();
fNPhi = fEMCGeometry->GetNPhi();
fArm1EtaMax = fEMCGeometry->GetArm1EtaMax();
fArm1PhiMin = fEMCGeometry->GetArm1PhiMin();
fArm1PhiMax = fEMCGeometry->GetArm1PhiMax();
+ fDCALPhiMin = fEMCGeometry->GetDCALPhiMin();
+ fDCALPhiMax = fEMCGeometry->GetDCALPhiMax();
+ fEMCALPhiMax = fEMCGeometry->GetEMCALPhiMax();
+ fDCALStandardPhiMax = fEMCGeometry->GetDCALStandardPhiMax();
+ fDCALInnerExtandedEta = fEMCGeometry->GetDCALInnerExtandedEta();
fShellThickness = fEMCGeometry->GetShellThickness();
fZLength = fEMCGeometry->GetZLength();
fSampling = fEMCGeometry->GetSampling();
}
for (Int_t ix = 0; ix < 48; ix++)
- for (Int_t jx = 0; jx < 64; jx++) fFastOR2DMap[ix][jx] = -1;
+ for(Int_t jx = 0; jx < 124; jx++) fFastOR2DMap[ix][jx] = -1;
BuildFastOR2DMap();
}
// 0 <= nIphi < fNPHIdiv
// 0 <= nIeta < fNETAdiv
// 0 <= absid < fNCells
- static Int_t id=0; // have to change from 0 to fNCells-1
- if(fKey110DEG == 1 && nSupMod >= 10 && !fGeoName.Contains("12SMV1")) { // 110 degree case; last two supermodules halfsupermodules
- id = fNCellsInSupMod*10 + (fNCellsInSupMod/2)*(nSupMod-10);
- } else if(fKey110DEG == 1 && nSupMod >= 10 && fGeoName.Contains("12SMV1")) { // 110 degree case; last two supermodules 1/3 supermodules
- id = fNCellsInSupMod*10 + (fNCellsInSupMod/3)*(nSupMod-10);
- } else {
- id = fNCellsInSupMod*nSupMod;
+ Int_t id=0; // have to change from 0 to fNCells-1
+ for( int i = 0 ; i < nSupMod; i++) {
+ if( GetSMType(i) == kEMCAL_Standard) id += fNCellsInSupMod;
+ else if( GetSMType(i) == kEMCAL_Half) id += fNCellsInSupMod/2;
+ else if( GetSMType(i) == kEMCAL_3rd) id += fNCellsInSupMod/3;
+ else if( GetSMType(i) == kDCAL_Standard) id += 2*fNCellsInSupMod/3;
+ else if( GetSMType(i) == kDCAL_Ext) id += fNCellsInSupMod/3;
+ else {
+ AliError(Form("Uknown SuperModule Type !!"));
+ }
}
+
id += fNCellsInModule *nModule;
id += fNPHIdiv *nIphi;
id += nIeta;
- if(id<0 || id >= fNCells) {
-// printf(" wrong numerations !!\n");
-// printf(" id %6i(will be force to -1)\n", id);
-// printf(" fNCells %6i\n", fNCells);
-// printf(" nSupMod %6i\n", nSupMod);
-// printf(" nModule %6i\n", nModule);
-// printf(" nIphi %6i\n", nIphi);
-// printf(" nIeta %6i\n", nIeta);
+ if( !CheckAbsCellId(id) ) {
id = -TMath::Abs(id); // if negative something wrong
}
return id;
if(TMath::Abs(eta) > fEtaMaxOfTRD1) return kFALSE;
phi = TVector2::Phi_0_2pi(phi); // move phi to (0,2pi) boundaries
- for(i=0; i<6; i++) {
-
- //Check if it is not the complete geometry
- if (i >= fEMCGeometry->GetNumberOfSuperModules()/2) return kFALSE;
-
+ Int_t nphism = fEMCGeometry->GetNumberOfSuperModules()/2;
+ for(i=0; i<nphism; i++) {
if(phi>=fPhiBoundariesOfSM[2*i] && phi<=fPhiBoundariesOfSM[2*i+1]) {
nSupMod = 2*i;
if(eta < 0.0) nSupMod++;
+ if( GetSMType(nSupMod) == kDCAL_Standard) {// Gap between DCAL
+ if(TMath::Abs(eta) < GetNEta()/3*(GetEMCGeometry()->GetTrd1Angle())*TMath::DegToRad()) return kFALSE;
+ }
AliDebug(1,Form("eta %f phi %f(%5.2f) : nSupMod %i : #bound %i", eta,phi,phi*TMath::RadToDeg(), nSupMod,i));
return kTRUE;
}
//________________________________________________________________________________________________
Bool_t AliEMCALGeometry::GetAbsCellIdFromEtaPhi(Double_t eta, Double_t phi, Int_t &absId) const
{
+
// Nov 17,2006
// stay here - phi problem as usual
- static Int_t nSupMod=-1, i=0, ieta=-1, iphi=-1, etaShift=0, nphi=-1;
+ static Int_t nSupMod=-1, i=0, ieta=-1, iphi=-1, etaShift=0, neta=-1, nphi=-1;
static Double_t absEta=0.0, d=0.0, dmin=0.0, phiLoc=0;
absId = nSupMod = - 1;
if(SuperModuleNumberFromEtaPhi(eta, phi, nSupMod)) {
phi = TVector2::Phi_0_2pi(phi);
phiLoc = phi - fPhiCentersOfSM[nSupMod/2];
nphi = fPhiCentersOfCells.GetSize();
- if(nSupMod>=10 && !fGeoName.Contains("12SMV1")) {
- phiLoc = phi - 190.*TMath::DegToRad(); // half-size case... the reference for the loc is still 190 deg..?
- nphi /= 2;
- }
- if(nSupMod>=10 && fGeoName.Contains("12SMV1")) {
- // in the one_third case the variable fPhiCentersOfSM behaves like for the full_module.
- nphi /= 3;
- }
-
+ if ( GetSMType(nSupMod) == kEMCAL_Half ) nphi /= 2;
+ else if( GetSMType(nSupMod) == kEMCAL_3rd ) nphi /= 3;
+ else if( GetSMType(nSupMod) == kDCAL_Ext ) nphi /= 3;
+
dmin = TMath::Abs(fPhiCentersOfCells[0]-phiLoc);
iphi = 0;
for(i=1; i<nphi; i++) {
}
// odd SM are turned with respect of even SM - reverse indexes
AliDebug(2,Form(" iphi %i : dmin %f (phi %f, phiLoc %f ) ", iphi, dmin, phi, phiLoc));
+
// eta index
absEta = TMath::Abs(eta);
- etaShift = iphi*fCentersOfCellsEtaDir.GetSize();
- dmin = TMath::Abs(fEtaCentersOfCells[etaShift]-absEta);
+ neta = fCentersOfCellsEtaDir.GetSize();
+ etaShift = iphi*neta;
ieta = 0;
- for(i=1; i<fCentersOfCellsEtaDir.GetSize(); i++) {
+ if( GetSMType(nSupMod) == kDCAL_Standard) ieta += 16; //jump 16 cells for DCSM
+ dmin = TMath::Abs(fEtaCentersOfCells[etaShift + ieta]-absEta);
+ for(i= ieta+1 ; i<neta; i++) {
d = TMath::Abs(fEtaCentersOfCells[i+etaShift] - absEta);
if(d < dmin) {
dmin = d;
ieta = i;
}
}
+ if( GetSMType(nSupMod) == kDCAL_Standard) ieta -= 16; //jump 16 cells for DCSM
+
AliDebug(2,Form(" ieta %i : dmin %f (eta=%f) : nSupMod %i ", ieta, dmin, eta, nSupMod));
//patch for mapping following alice convention
- if(nSupMod%2 == 0)
- ieta = (fCentersOfCellsEtaDir.GetSize()-1)-ieta;// 47-ieta, revert the ordering on A side in order to keep convention.
-
- absId = GetAbsCellIdFromCellIndexes(nSupMod, iphi, ieta);
+ if(nSupMod%2 == 0) {// 47 + 16 -ieta for DCSM, 47 - ieta for others, revert the ordering on A side in order to keep convention.
+ ieta = (neta -1)-ieta;
+ if( GetSMType(nSupMod) == kDCAL_Standard) ieta -= 16; //recover cells for DCSM
+ }
+ absId = GetAbsCellIdFromCellIndexes(nSupMod, iphi, ieta);
return kTRUE;
}
return kFALSE;
// nIphi - cell number in phi driection inside module; 0<= nIphi < fNPHIdiv;
// nIeta - cell number in eta driection inside module; 0<= nIeta < fNETAdiv;
//
- static Int_t tmp=0, sm10=0;
if(!CheckAbsCellId(absId)) return kFALSE;
- sm10 = fNCellsInSupMod*10;
- if(fKey110DEG == 1 && absId >= sm10 && !fGeoName.Contains("12SMV1")) { // 110 degree case; last two supermodules are halfsupermodules
- nSupMod = (absId-sm10) / (fNCellsInSupMod/2) + 10;
- tmp = (absId-sm10) % (fNCellsInSupMod/2);
- } else if(fKey110DEG == 1 && absId >= sm10 && fGeoName.Contains("12SMV1")) { // 110 degree case; last two supermodules are 1/3 supermodules
- nSupMod = (absId-sm10) / (fNCellsInSupMod/3) + 10;
- tmp = (absId-sm10) % (fNCellsInSupMod/3);
- } else {
- nSupMod = absId / fNCellsInSupMod;
- tmp = absId % fNCellsInSupMod;
+ static Int_t tmp = absId;
+ Int_t test = absId;
+
+ for(nSupMod = -1; test >= 0; ) {
+ nSupMod++;
+ tmp = test;
+ if( GetSMType(nSupMod) == kEMCAL_Standard) test -= fNCellsInSupMod;
+ else if( GetSMType(nSupMod) == kEMCAL_Half) test -= fNCellsInSupMod/2;
+ else if( GetSMType(nSupMod) == kEMCAL_3rd) test -= fNCellsInSupMod/3;
+ else if( GetSMType(nSupMod) == kDCAL_Standard) test -= 2*fNCellsInSupMod/3;
+ else if( GetSMType(nSupMod) == kDCAL_Ext) test -= fNCellsInSupMod/3;
+ else {
+ AliError(Form("Uknown SuperModule Type !!"));
+ return kFALSE;
+ }
}
-
- nModule = tmp / fNCellsInModule;
+ nModule = tmp / fNCellsInModule;
tmp = tmp % fNCellsInModule;
nIphi = tmp / fNPHIdiv;
nIeta = tmp % fNPHIdiv;
// ietam - have to change from 0 to fNZ-1
// iphim - have to change from 0 to nphi-1 (fNPhi-1 or fNPhi/2-1)
static Int_t nphi=-1;
-
- if(fKey110DEG == 1 && nSupMod>=10 && !fGeoName.Contains("12SMV1") ) nphi = fNPhi/2; // halfSM
- else if(fKey110DEG == 1 && nSupMod>=10 && fGeoName.Contains("12SMV1") ) nphi = fNPhi/3; // 1/3 SM
- else nphi = fNPhi; // full SM
-
+ if( GetSMType(nSupMod) == kEMCAL_Half ) nphi = fNPhi/2; // halfSM
+ else if( GetSMType(nSupMod) == kEMCAL_3rd ) nphi = fNPhi/3; // 1/3 SM
+ else if( GetSMType(nSupMod) == kDCAL_Ext ) nphi = fNPhi/3; // 1/3 SM
+ else nphi = fNPhi; // full SM
+
ietam = nModule/nphi;
iphim = nModule%nphi;
}
// Shift index taking into account the difference between standard SM
// and SM of half (or one third) size in phi direction
- Int_t workaround; // a small trick to be able to define the const variable kphiIndexShift
- //if half, two parts, 1/4 wide, should be remove. In case of one_third SM, the two parts to be removed are 1/3 each
- if(fKey110DEG == 1 && !fGeoName.Contains("12SMV1")) workaround=4; // half SM case
- else workaround=3; // one third of SM case
- const Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/workaround;
- const Int_t kphiRangeSmallSM = fCentersOfCellsPhiDir.GetSize()-2*kphiIndexShift;
+ const Int_t kNphiIndex = fCentersOfCellsPhiDir.GetSize();
+ Double_t zshift = 0.5*GetDCALInnerEdge();
static Int_t nSupMod=-1, nModule=-1, nIphi=-1, nIeta=-1, iphi=-1, ieta=-1;
if(!CheckAbsCellId(absId)) return kFALSE;
//Get eta position. Careful with ALICE conventions (increase index decrease eta)
Int_t ieta2 = ieta;
- if(nSupMod%2 == 0)
- ieta2 = (fCentersOfCellsEtaDir.GetSize()-1)-ieta;// 47-ieta, revert the ordering on A side in order to keep convention.
+ if(nSupMod%2 == 0) {
+ ieta2 = (fCentersOfCellsEtaDir.GetSize()-1)-ieta;// 47-ieta, revert the ordering on A side in order to keep convention.
+ }
+ if( GetSMType(nSupMod) == kDCAL_Standard && nSupMod%2 ) ieta2 += 16; // DCAL revert the ordering on C side ...
zr = fCentersOfCellsEtaDir.At(ieta2);
+ if( GetSMType(nSupMod) == kDCAL_Standard ) zr -= zshift; // DCAL shift (SMALLER SM)
xr = fCentersOfCellsXDir.At(ieta2);
//Get phi position. Careful with ALICE conventions (increase index increase phi)
Int_t iphi2 = iphi;
- if(nSupMod<10) {
- if(nSupMod%2 != 0)
- iphi2 = (fCentersOfCellsPhiDir.GetSize()-1)-iphi;// 23-iphi, revert the ordering on C side in order to keep convention.
- yr = fCentersOfCellsPhiDir.At(iphi2);
-
+ if( GetSMType(nSupMod) == kDCAL_Ext ) {
+ if(nSupMod%2 != 0) iphi2 = (kNphiIndex/3 -1)-iphi; // 7-iphi [1/3SM], revert the ordering on C side in order to keep convention.
+ yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/3);
+ } else if( GetSMType(nSupMod) == kEMCAL_Half ){
+ if(nSupMod%2 != 0) iphi2 = (kNphiIndex/2 -1)-iphi; //11-iphi [1/2SM], revert the ordering on C side in order to keep convention.
+ yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/4);
+ } else if( GetSMType(nSupMod) == kEMCAL_3rd ){
+ if(nSupMod%2 != 0) iphi2 = (kNphiIndex/3 -1)-iphi; // 7-iphi [1/3SM], revert the ordering on C side in order to keep convention.
+ yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/3);
} else {
- if(nSupMod%2 != 0)
- iphi2 = (kphiRangeSmallSM-1)-iphi;// 11-iphi [1/2SM] or 7-iphi [1/3SM], revert the ordering on C side in order to keep convention.
- yr = fCentersOfCellsPhiDir.At(iphi2 + kphiIndexShift);
- }
+ if(nSupMod%2 != 0) iphi2 = (kNphiIndex -1)-iphi;// 23-iphi, revert the ordering on C side in order to keep conventi
+ yr = fCentersOfCellsPhiDir.At(iphi2);
+ }
AliDebug(1,Form("absId %i nSupMod %i iphi %i ieta %i xr %f yr %f zr %f ",absId,nSupMod,iphi,ieta,xr,yr,zr));
return kTRUE;
// Shift index taking into account the difference between standard SM
// and SM of half (or one third) size in phi direction
-
- Int_t workaround; // a small trick to be able to define the const variable kphiIndexShift
- //if half, two parts, 1/4 wide, should be remove. In case of one_third SM, the two parts to be removed are 1/3 each
- if(fKey110DEG == 1 && !fGeoName.Contains("12SMV1")) workaround=4; // half SM case
- else workaround=3; // one third of SM case
- const Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/workaround;
- const Int_t kphiRangeSmallSM = fCentersOfCellsPhiDir.GetSize()-2*kphiIndexShift;
+
+ const Int_t kNphiIndex = fCentersOfCellsPhiDir.GetSize();
+ Double_t zshift = 0.5*GetDCALInnerEdge();
+ Int_t kDCalshift = 8;//wangml DCal cut first 8 modules(16 cells)
static Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1, iphi=-1, ieta=-1;
static Int_t iphim=-1, ietam=-1;
//Get eta position. Careful with ALICE conventions (increase index decrease eta)
if(nSupMod%2 == 0) {
- ietam = (fCentersOfCellsEtaDir.GetSize()/2-1)-ietam;// 47-ietam, revert the ordering on A side in order to keep convention.
+ ietam = (fCentersOfCellsEtaDir.GetSize()/2-1)-ietam;// 24-ietam, revert the ordering on A side in order to keep convention.
if(nIeta == 0) nIeta = 1;
else nIeta = 0;
}
+ if( GetSMType(nSupMod) == kDCAL_Standard && nSupMod%2) ietam += kDCalshift; // DCAL revert the ordering on C side ....
mod = GetShishKebabModule(ietam);
mod ->GetPositionAtCenterCellLine(nIeta, distEff, v);
xr = v.Y() - fParSM[0];
zr = v.X() - fParSM[2];
-
+ if( GetSMType(nSupMod) == kDCAL_Standard ) zr -= zshift; // DCAL shift (SMALLER SM)
+
//Get phi position. Careful with ALICE conventions (increase index increase phi)
Int_t iphi2 = iphi;
- if(nSupMod<10) {
- if(nSupMod%2 != 0)
- iphi2 = (fCentersOfCellsPhiDir.GetSize()-1)-iphi;// 23-iphi, revert the ordering on C side in order to keep convention.
- yr = fCentersOfCellsPhiDir.At(iphi2);
-
- } else {
- if(nSupMod%2 != 0)
- iphi2 = (kphiRangeSmallSM-1)-iphi;// 11-iphi [1/2SM] or 7-iphi [1/3SM], revert the ordering on C side in order to keep convention.
- yr = fCentersOfCellsPhiDir.At(iphi2 + kphiIndexShift);
- }
+ if( GetSMType(nSupMod) == kDCAL_Ext ) {
+ if(nSupMod%2 != 0) iphi2 = (kNphiIndex/3 -1)-iphi; // 7-iphi [1/3SM], revert the ordering on C side in order to keep convention.
+ yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/3);
+ } else if( GetSMType(nSupMod) == kEMCAL_Half ){
+ if(nSupMod%2 != 0) iphi2 = (kNphiIndex/2 -1)-iphi; //11-iphi [1/2SM], revert the ordering on C side in order to keep convention.
+ yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/2);
+ } else if( GetSMType(nSupMod) == kEMCAL_3rd ){
+ if(nSupMod%2 != 0) iphi2 = (kNphiIndex/3 -1)-iphi; // 7-iphi [1/3SM], revert the ordering on C side in order to keep convention.
+ yr = fCentersOfCellsPhiDir.At(iphi2 + kNphiIndex/3);
+ } else {
+ if(nSupMod%2 != 0) iphi2 = (kNphiIndex -1)-iphi;// 23-iphi, revert the ordering on C side in order to keep convention.
+ yr = fCentersOfCellsPhiDir.At(iphi2);
+ }
AliDebug(1,Form("absId %i nSupMod %i iphi %i ieta %i xr %f yr %f zr %f ",absId,nSupMod,iphi,ieta,xr,yr,zr));
//_____________________________________________________________________________
Bool_t AliEMCALGeometry::IsInEMCAL(Double_t x, Double_t y, Double_t z) const
{
- // Checks whether point is inside the EMCal volume, used in AliEMCALv*.cxx
+ // Checks whether point is inside the EMCal volume
+ if( IsInEMCALOrDCAL(x,y,z) == 1 ) return kTRUE;
+ else return kFALSE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliEMCALGeometry::IsInDCAL(Double_t x, Double_t y, Double_t z) const
+{
+ // Checks whether point is inside the DCal volume
+ if( IsInEMCALOrDCAL(x,y,z) == 2 ) return kTRUE;
+ else return kFALSE;
+}
+
+//_____________________________________________________________________________
+Int_t AliEMCALGeometry::IsInEMCALOrDCAL(Double_t x, Double_t y, Double_t z) const
+{
+ // Checks whether point is inside the EMCal volume (included DCal), used in AliEMCALv*.cxx
//
// Code uses cylindrical approximation made of inner radius (for speed)
//
- // Points behind EMCAl, i.e. R > outer radius, but eta, phi in acceptance
+ // Points behind EMCAl/DCal, i.e. R > outer radius, but eta, phi in acceptance
// are considered to inside
Double_t r=sqrt(x*x+y*y);
- if ( r > fEnvelop[0] ) {
- Double_t theta;
- theta = TMath::ATan2(r,z);
- Double_t eta;
- if(theta == 0)
- eta = 9999;
- else
- eta = -TMath::Log(TMath::Tan(theta/2.));
- if (eta < fArm1EtaMin || eta > fArm1EtaMax)
- return 0;
-
- Double_t phi = TMath::ATan2(y,x) * 180./TMath::Pi();
- if (phi < 0) phi += 360; // phi should go from 0 to 360 in this case
- if (phi > fArm1PhiMin && phi < fArm1PhiMax)
- return 1;
- }
- return 0;
+ if ( r <= fEnvelop[0] ) return 0;
+ else {
+ Double_t theta = TMath::ATan2(r,z);
+ Double_t eta;
+ if(theta == 0) eta = 9999;
+ else eta = -TMath::Log(TMath::Tan(theta/2.));
+ if (eta < fArm1EtaMin || eta > fArm1EtaMax) return 0;
+
+ Double_t phi = TMath::ATan2(y,x) * 180./TMath::Pi();
+ if (phi < 0) phi += 360; // phi should go from 0 to 360 in this case
+
+ if ( phi >= fArm1PhiMin && phi <= fEMCALPhiMax ) return 1;
+ else if ( phi >= fDCALPhiMin && phi <= fDCALStandardPhiMax && TMath::Abs(eta) > fDCALInnerExtandedEta ) return 2;
+ else if ( phi > fDCALStandardPhiMax && phi <= fDCALPhiMax ) return 2;
+ else return 0;
+ }
}
//________________________________________________________________________________________________
{
//Trigger mapping method, get FastOr Index from TRU
- if (iTRU > 31 || iTRU < 0 || iADC > 95 || iADC < 0)
+ if (iTRU > GetNTotalTRU()-1 || iTRU < 0 || iADC > 95 || iADC < 0)
{
AliError("TRU out of range!");
return kFALSE;
{
//Trigger mapping method, get TRU number from FastOr Index
- if (id > 3071 || id < 0)
+ Int_t nModule = GetNTotalTRU()*96;
+ if (id > nModule-1 || id < 0)
{
AliError("Id out of range!");
return kFALSE;
Bool_t AliEMCALGeometry::GetAbsFastORIndexFromPositionInTRU(const Int_t iTRU, const Int_t iEta, const Int_t iPhi, Int_t& id) const
{
//Trigger mapping method, get Index if FastOr from Position in TRU
- if (iTRU < 0 || iTRU > 31 || iEta < 0 || iEta > 23 || iPhi < 0 || iPhi > 3)
+ if (iTRU < 0 || iTRU > GetNTotalTRU()-1 || iEta < 0 || iEta > 23 || iPhi < 0 || iPhi > 3)
{
- AliError("Out of range!");
+ AliError(Form("Out of range! iTRU=%d, iEta=%d, iPhi=%d", iTRU, iEta, iPhi));
return kFALSE;
}
id = iPhi + 4 * iEta + iTRU * 96;
{
//Trigger mapping method, from position in SM Index get FastOR index
- if (iSM < 0 || iSM > 11 || iEta < 0 || iEta > 23 || iPhi < 0 || iPhi > 11)
+ Int_t iSMMax = fEMCGeometry->GetNumberOfSuperModules();
+ Int_t iEtaMax = fEMCGeometry->GetNZ();
+ Int_t iPhiMax = fEMCGeometry->GetNPhi();
+ if( GetSMType(iSM) == kEMCAL_3rd || GetSMType(iSM) == kDCAL_Ext ) iPhiMax /= 3;
+ if( GetSMType(iSM) == kEMCAL_Half ) iPhiMax /= 2;
+ if( GetSMType(iSM) == kDCAL_Standard ) iEtaMax = iEtaMax*2/3;
+
+ if (iSM < 0 || iSM >= iSMMax || iEta < 0 || iEta >= iEtaMax || iPhi < 0 || iPhi >= iPhiMax)
{
AliError("Out of range!");
return kFALSE;
Int_t y = iPhi % 4;
Int_t iOff = (iSM % 2) ? 1 : 0;
Int_t iTRU = 2 * int(iPhi / 4) + 6 * int(iSM / 2) + iOff;
+ if(IsDCALSM(iSM) ) iTRU -=4;
if (GetAbsFastORIndexFromPositionInTRU(iTRU, x, y, id))
{
return kTRUE;
{
//Trigger mapping method, from position in EMCAL Index get FastOR index
- if (iEta < 0 || iEta > 47 || iPhi < 0 || iPhi > 63 )
+ if (iEta < 0 || iEta > 47 || iPhi < 0 || iPhi >= 2*GetNTotalTRU() )//for future DCAL trigge
{
AliError(Form("Out of range! eta: %2d phi: %2d", iEta, iPhi));
return kFALSE;
{
//Trigger mapping method, from STU index get TRU index
- if (id > 31 || id < 0)
- {
- AliError(Form("TRU index out of range: %d",id));
- return kFALSE;
- }
- idx = (id > 15) ? 2 * (31 - id) : 2 * (15 - id) + 1;
- return kTRUE;
+ idx = GetTRUIndexFromSTUIndex(id);
+ if (idx > GetNTotalTRU()-1 || idx < 0)
+ {
+ AliError(Form("TRU index out of range: %d",idx));
+ return kFALSE;
+ }
+ return kTRUE;
}
//________________________________________________________________________________________________
{
//Trigger mapping method, from STU index get TRU index
- if (id > 31 || id < 0)
+ if (id > GetNTotalTRU()-1 || id < 0)
{
AliError(Form("TRU index out of range: %d",id));
}
- Int_t idx = (id > 15) ? 2 * (31 - id) : 2 * (15 - id) + 1;
+
+ Int_t idx = 0;
+ if(id < 32){
+ idx = (id > 15) ? 2 * (31 - id) : 2 * (15 - id) + 1;
+ } else if(id >= 32){// DCAL
+ idx = (id > 32+3*fnSupModInDCAL/2-1) ? 2 * (GetNTotalTRU()-1 - id)+32 : 2 * (32+3*fnSupModInDCAL/2-1 - id) + 32+1;
+ }
return idx;
}
{
// Needed by STU
- for (Int_t i = 0; i < 32; i++)
+ for (Int_t i = 0; i < GetNTotalTRU(); i++)
{
for (Int_t j = 0; j < 24; j++)
{
Bool_t AliEMCALGeometry::GetTRUIndexFromOnlineIndex(const Int_t id, Int_t& idx) const
{
//Trigger mapping method, from STU index get TRU index
-
- if (id > 31 || id < 0)
- {
- AliError(Form("TRU index out of range: %d",id));
- return kFALSE;
- }
- if (id == 31) {
- idx = 31;
- return kTRUE;
- }
- idx = ((id % 6) < 3) ? 6 * int(id / 6) + 2 * (id % 3) : 6 * int(id / 6) + 2 * (2 - (id % 3)) + 1;
- return kTRUE;
+
+ idx = GetOnlineIndexFromTRUIndex(id);
+ if (idx > GetNTotalTRU()-1 || idx < 0)
+ {
+ AliError(Form("TRU index out of range: %d",idx));
+ return kFALSE;
+ }
+ return kTRUE;
}
//________________________________________________________________________________________________
{
//Trigger mapping method, from STU index get TRU index
- if (id > 31 || id < 0)
+ if (id > GetNTotalTRU()-1 || id < 0)
{
AliError(Form("TRU index out of range: %d",id));
}
if (id == 31) {
return 31;
}
- Int_t idx = ((id % 6) < 3) ? 6 * int(id / 6) + 2 * (id % 3) : 6 * int(id / 6) + 2 * (2 - (id % 3)) + 1;
+ if (fGeoName.Contains("DCAL_8SM") && id == 51) {
+ return 51;
+ }
+
+ //jump 4 TRUs for DCAL
+ Int_t tmp=0;
+ if(id > 31) tmp = id+4;
+ else tmp = id;
+ Int_t idx = ((tmp% 6) < 3) ? 6 * int(tmp/ 6) + 2 * (tmp% 3) : 6 * int(tmp/ 6) + 2 * (2 - (tmp% 3)) + 1;
+ if(id > 31) idx-=4;
return idx;
}
Bool_t AliEMCALGeometry::GetOnlineIndexFromTRUIndex(const Int_t id, Int_t& idx) const
{
//Trigger mapping method, from STU index get TRU index
-
- if (id > 31 || id < 0)
- {
- AliError(Form("TRU index out of range: %d",id));
- return kFALSE;
- }
- if (id == 31) {
- idx = 31;
- return kTRUE;
- }
- idx = (id % 2) ? int((6 - (id % 6)) / 2) + 3 * (2 * int(id / 6) + 1) : 3 * int(id / 6) + int(id / 2);
- return kTRUE;
+
+ idx = GetOnlineIndexFromTRUIndex(id);
+ if (idx > GetNTotalTRU()-1 || idx < 0)
+ {
+ AliError(Form("TRU index out of range: %d",idx));
+ return kFALSE;
+ }
+ return kTRUE;
}
-
//________________________________________________________________________________________________
Int_t AliEMCALGeometry::GetOnlineIndexFromTRUIndex(const Int_t id) const
{
//Trigger mapping method, from STU index get TRU index
- if (id > 31 || id < 0)
+ if (id > GetNTotalTRU()-1 || id < 0)
{
AliError(Form("TRU index out of range: %d",id));
}
if (id == 31) {
return 31;
}
- Int_t idx = (id % 2) ? int((6 - (id % 6)) / 2) + 3 * (2 * int(id / 6) + 1) : 3 * int(id / 6) + int(id / 2);
+ if (fGeoName.Contains("DCAL_8SM") && id == 51) {
+ return 51;
+ }
+
+ //jump 4 TRUs for DCAL
+ Int_t tmp=0;
+ if(id > 31) tmp = id+4;
+ else tmp = id;
+ Int_t idx = (tmp % 2) ? int((6 - (tmp % 6)) / 2) + 3 * (2 * int(tmp / 6) + 1) : 3 * int(tmp / 6) + int(tmp / 2);
+ if(id > 31) idx-=4;
return idx;
}
if(gGeoManager){
const Int_t buffersize = 255;
char path[buffersize] ;
- snprintf(path,buffersize,"/ALIC_1/XEN1_1/SMOD_%d",smod+1) ;
- //TString volpath = "ALIC_1/XEN1_1/SMOD_";
- //volpath += smod+1;
-
- if(fKey110DEG && smod >= 10 && !fGeoName.Contains("12SMV1") ){
- snprintf(path,buffersize,"/ALIC_1/XEN1_1/SM10_%d",smod-10+1) ;
- //volpath = "ALIC_1/XEN1_1/SM10_";
- //volpath += smod-10+1;
- }
- if(fKey110DEG && smod >= 10 && fGeoName.Contains("12SMV1") ){
- snprintf(path,buffersize,"/ALIC_1/XEN1_1/SM3rd_%d",smod-10+1) ;
- //volpath = "ALIC_1/XEN1_1/SM10_";
- //volpath += smod-10+1;
- }
+ TString SMName;
+ Int_t tmpType = -1;
+ Int_t SMOrder = 0;
+//Get the order for SM
+ for( Int_t i = 0; i < smod+1; i++){
+ if(GetSMType(i) == tmpType) {
+ SMOrder++;
+ } else {
+ tmpType = GetSMType(i);
+ SMOrder = 1;
+ }
+ }
+
+ if(GetSMType(smod) == kEMCAL_Standard ) SMName = "SMOD";
+ else if(GetSMType(smod) == kEMCAL_Half ) SMName = "SM10";
+ else if(GetSMType(smod) == kEMCAL_3rd ) SMName = "SM3rd";
+ else if( GetSMType(smod) == kDCAL_Standard ) SMName = "DCSM";
+ else if( GetSMType(smod) == kDCAL_Ext ) SMName = "DCEXT";
+ else AliError("Unkown SM Type!!");
+ snprintf(path,buffersize,"/ALIC_1/XEN1_1/%s_%d", SMName.Data(), SMOrder) ;
+
if (!gGeoManager->cd(path)){
AliFatal(Form("Geo manager can not find path %s!\n",path));
}
return gGeoManager->GetCurrentMatrix();
}
-
return 0 ;
}
}
}
+//__________________________________________________________________________________________________________________
void AliEMCALGeometry::SetMisalMatrix(const TGeoHMatrix * m, Int_t smod)
{
// Method to set shift-rotational matrixes from ESDHeader
if(!fkSModuleMatrix[smod]) fkSModuleMatrix[smod] = new TGeoHMatrix(*m) ; //Set only if not set yet
} else AliFatal(Form("Wrong supermodule index -> %d",smod));
}
+
+//__________________________________________________________________________________________________________________
+Bool_t AliEMCALGeometry::IsDCALSM(Int_t iSupMod) const
+{
+ if( fEMCSMSystem[iSupMod] == kDCAL_Standard || fEMCSMSystem[iSupMod] == kDCAL_Ext ) return kTRUE;
+ return kFALSE;
+}
+
+//__________________________________________________________________________________________________________________
+Bool_t AliEMCALGeometry::IsDCALExtSM(Int_t iSupMod) const
+{
+ if( fEMCSMSystem[iSupMod] == kDCAL_Ext ) return kTRUE;
+ return kFALSE;
+}
//*-- and : Alexei Pavlinov (WSU) - shashlyk staff
//*-- and : Gustavo Conesa: Add TRU mapping. TRU parameters still not fixed.
//*-- and : Magali Estienne : analysis access adaptations
+//*-- and : Adapted for DCAL, M.L. Wang CCNU & Subatech Oct-18-2012
// --- ROOT system ---
#include <TNamed.h>
class AliEMCALGeometry : public TNamed {
public:
+ enum fEMCSMType { kEMCAL_Standard = 0, kEMCAL_Half = 1, kEMCAL_3rd = 2, kDCAL_Standard = 3, kDCAL_Ext= 4 }; // possible SM Type
AliEMCALGeometry();
AliEMCALGeometry(const Text_t* name, const Text_t* title="",
virtual Bool_t Impact(const TParticle *particle) const;
void ImpactOnEmcal(TVector3 vtx, Double_t theta, Double_t phi, Int_t & absId, TVector3 & vimpact) const;
Bool_t IsInEMCAL(Double_t x, Double_t y, Double_t z) const;
+ Bool_t IsInDCAL(Double_t x, Double_t y, Double_t z) const;
+ Int_t IsInEMCALOrDCAL(Double_t x, Double_t y, Double_t z) const;
//////////////////////////////////////
// Return EMCAL geometrical parameters
Float_t GetEnvelop(Int_t index) const { return fEMCGeometry->GetEnvelop(index) ; }
Float_t GetShellThickness(void) const { return fEMCGeometry->GetShellThickness() ; }
Float_t GetZLength(void) const { return fEMCGeometry->GetZLength() ; }
+ Float_t GetDCALInnerEdge(void) const { return fEMCGeometry->GetDCALInnerEdge() ; }
+ Float_t GetDCALPhiMin(void) const { return fEMCGeometry->GetDCALPhiMin() ; }
+ Float_t GetDCALPhiMax(void) const { return fEMCGeometry->GetDCALPhiMax() ; }
+ Float_t GetEMCALPhiMax(void) const { return fEMCGeometry->GetEMCALPhiMax() ; }
Int_t GetNECLayers(void) const { return fEMCGeometry->GetNECLayers() ; }
+ Float_t GetDCALInnerExtandedEta(void) const { return fEMCGeometry->GetDCALInnerExtandedEta() ; }
Int_t GetNZ(void) const { return fEMCGeometry->GetNZ() ; }
Int_t GetNEta(void) const { return fEMCGeometry->GetNEta() ; }
Int_t GetNPhi(void) const { return fEMCGeometry->GetNPhi() ; }
Float_t GetECScintThick(void) const { return fEMCGeometry->GetECScintThick() ; }
Float_t GetSampling(void) const { return fEMCGeometry->GetSampling() ; }
Int_t GetNumberOfSuperModules(void) const { return fEMCGeometry->GetNumberOfSuperModules() ; }
- Float_t GetPhiGapForSuperModules(void) const { return fEMCGeometry->GetfPhiGapForSuperModules() ; }
+ Float_t GetPhiGapForSuperModules(void) const { return fEMCGeometry->GetPhiGapForSuperModules(); }
Float_t GetPhiModuleSize(void) const { return fEMCGeometry->GetPhiModuleSize() ; }
Float_t GetEtaModuleSize(void) const { return fEMCGeometry->GetEtaModuleSize() ; }
Float_t GetFrontSteelStrip(void) const { return fEMCGeometry->GetFrontSteelStrip() ; }
Float_t GetPassiveScintThick(void) const { return fEMCGeometry->GetPassiveScintThick() ; }
Float_t GetPhiTileSize(void) const { return fEMCGeometry->GetPhiTileSize() ; }
Float_t GetEtaTileSize(void) const { return fEMCGeometry->GetEtaTileSize() ; }
+ Float_t GetPhiSuperModule(void) const { return fEMCGeometry->GetPhiSuperModule() ; }
Int_t GetNPhiSuperModule(void) const { return fEMCGeometry->GetNPhiSuperModule() ; }
Int_t GetNPHIdiv(void) const { return fEMCGeometry->GetNPHIdiv() ; }
Int_t GetNETAdiv(void) const { return fEMCGeometry->GetNETAdiv() ; }
Int_t GetNCellsInSupMod(void) const { return fEMCGeometry->GetNCellsInSupMod() ; }
Int_t GetNCellsInModule(void) const { return fEMCGeometry->GetNCellsInModule() ; }
Int_t GetKey110DEG(void) const { return fEMCGeometry->GetKey110DEG() ; }
+ Int_t GetnSupModInDCAL(void) const { return fEMCGeometry->GetnSupModInDCAL() ; }
Int_t GetILOSS(void) const { return fEMCGeometry->GetILOSS() ; }
Int_t GetIHADR(void) const { return fEMCGeometry->GetIHADR() ; }
// --
Int_t GetNTowers(void) const { return fEMCGeometry->GetNTowers() ; }
//
Double_t GetPhiCenterOfSM(Int_t nsupmod) const { return fEMCGeometry->GetPhiCenterOfSM(nsupmod) ; }
+ Double_t GetPhiCenterOfSMSec(Int_t nsupmod) const { return fEMCGeometry->GetPhiCenterOfSMSec(nsupmod) ; }
Float_t GetSuperModulesPar(Int_t ipar) const { return fEMCGeometry->GetSuperModulesPar(ipar) ; }
//
+ Int_t GetSMType(Int_t nSupMod) const { if( nSupMod > fEMCGeometry->GetNumberOfSuperModules() ) return -1;
+ return fEMCSMSystem[nSupMod] ; }
+ Bool_t IsDCALSM(Int_t nSupMod) const;
+ Bool_t IsDCALExtSM(Int_t nSupMod) const;
Bool_t GetPhiBoundariesOfSM(Int_t nSupMod, Double_t &phiMin, Double_t &phiMax) const
{ return fEMCGeometry->GetPhiBoundariesOfSM(nSupMod, phiMin, phiMax) ; }
Bool_t GetPhiBoundariesOfSMGap(Int_t nPhiSec, Double_t &phiMin, Double_t &phiMax) const
{ return fEMCGeometry->GetPhiBoundariesOfSMGap(nPhiSec, phiMin, phiMax); }
//
+ // especially for SM in extension, where center of SM != center of the SM-section.
+ // Used in AliEMCALv0 to calculate position.
//////////////////////////////////////////////////
// Obsolete methods to be thrown out when feasible
Int_t GetSuperModuleNumber(Int_t absId) const;
Int_t GetNumberOfModuleInPhiDirection(Int_t nSupMod) const
{
- if(fKey110DEG == 1 && nSupMod>=10 && !fGeoName.Contains("12SMV1")) return fNPhi/2;
- else if(fKey110DEG == 1 && nSupMod>=10 && fGeoName.Contains("12SMV1")) return fNPhi/3;
- else return fNPhi;
+ if( GetSMType(nSupMod) == kEMCAL_Half) return fNPhi/2;
+ else if(GetSMType(nSupMod) == kEMCAL_3rd) return fNPhi/3;
+ else if(GetSMType(nSupMod) == kDCAL_Ext) return fNPhi/3;
+ else return fNPhi;
}
// From cell indexes to abs cell id
void GetModuleIndexesFromCellIndexesInSModule(Int_t nSupMod, Int_t iphi, Int_t ieta,
Bool_t RelPosCellInSModule(Int_t absId, Double_t loc[3]) const;
Bool_t RelPosCellInSModule(Int_t absId, TVector3 &vloc) const;
+ Int_t * GetEMCSystem() const { return fEMCSMSystem ; } //EMC System, SM type list
// Local Coordinates of SM
TArrayD GetCentersOfCellsEtaDir() const { return fCentersOfCellsEtaDir ; } // size fNEta*fNETAdiv (for TRD1 only) (eta or z in SM, in cm)
TArrayD GetCentersOfCellsXDir() const { return fCentersOfCellsXDir ; } // size fNEta*fNETAdiv (for TRD1 only) ( x in SM, in cm)
Int_t GetNModulesInTRU() const { return fEMCGeometry->GetNModulesInTRU() ; }
Int_t GetNModulesInTRUEta() const { return fEMCGeometry->GetNModulesInTRUEta() ; }
Int_t GetNModulesInTRUPhi() const { return fEMCGeometry->GetNModulesInTRUPhi() ; }
+ Int_t GetNTotalTRU() const {return fEMCGeometry->GetNTotalTRU() ; }
// *MEFIX OLD TO BE REMOVED*
//
AliEMCALEMCGeometry * fEMCGeometry;// Geometry object for Electromagnetic calorimeter
TString fGeoName; // geometry name
+ Int_t *fEMCSMSystem; // geometry structure
Int_t fKey110DEG; // for calculation abs cell id; 19-oct-05
+ Int_t fnSupModInDCAL; // for calculation abs cell id; 06-nov-12
Int_t fNCellsInSupMod; // number cell in super module
Int_t fNETAdiv; // number eta divizion of module
Int_t fNPHIdiv; // number phi divizion of module
Int_t fNCellsInModule; // number cell in module
TArrayD fPhiBoundariesOfSM; // phi boundaries of SM in rad; size is fNumberOfSuperModules;
- TArrayD fPhiCentersOfSM; // phi of centers of SMl size is fNumberOfSuperModules/2
+ TArrayD fPhiCentersOfSM; // phi of centers of SM; size is fNumberOfSuperModules/2
+ TArrayD fPhiCentersOfSMSec; // phi of centers of section where SM lies; size is fNumberOfSuperModules/2
// Local Coordinates of SM
TArrayD fPhiCentersOfCells; // [fNPhi*fNPHIdiv] from center of SM (-10. < phi < +10.)
TArrayD fCentersOfCellsEtaDir; // size fNEta*fNETAdiv (for TRD1 only) (eta or z in SM, in cm)
TArrayD fCentersOfCellsPhiDir; // size fNPhi*fNPHIdiv (for TRD1 only) (phi or y in SM, in cm)
TArrayD fEtaCentersOfCells; // [fNEta*fNETAdiv*fNPhi*fNPHIdiv], positive direction (eta>0); eta depend from phi position;
Int_t fNCells; // number of cells in calo
- Int_t fNPhi; // Number of Towers in the PHI direction
+ Int_t fNPhi; // Number of Towers in the PHI direction
TArrayD fCentersOfCellsXDir; // size fNEta*fNETAdiv (for TRD1 only) ( x in SM, in cm)
Float_t fEnvelop[3]; // the GEANT TUB for the detector
Float_t fArm1EtaMin; // Minimum pseudorapidity position of EMCAL in Eta
Float_t fArm1PhiMin; // Minimum angular position of EMCAL in Phi (degrees)
Float_t fArm1PhiMax; // Maximum angular position of EMCAL in Phi (degrees)
Float_t fEtaMaxOfTRD1; // Max eta in case of TRD1 geometry (see AliEMCALShishKebabTrd1Module)
+ Float_t fDCALPhiMin; // Minimum angular position of DCAL in Phi (degrees)
+ Float_t fDCALPhiMax; // Maximum angular position of DCAL in Phi (degrees)
+ Float_t fEMCALPhiMax; // Maximum angular position of EMCAL in Phi (degrees)
+ Float_t fDCALStandardPhiMax; // special edge for the case that DCAL contian extension
+ Float_t fDCALInnerExtandedEta; // DCAL inner edge in Eta (with some extension)
TList *fShishKebabTrd1Modules; // list of modules
Float_t fParSM[3]; // SM sizes as in GEANT (TRD1)
Float_t fPhiModuleSize; // Phi -> X
Float_t fZLength; // Total length in z direction
Float_t fSampling; // Sampling factor
- Int_t fFastOR2DMap[48][64]; // FastOR 2D Map over full EMCal
+ Int_t fFastOR2DMap[48][124]; // FastOR 2D Map over full EMCal
TGeoHMatrix* fkSModuleMatrix[AliEMCALGeoParams::fgkEMCALModules] ; //Orientations of EMCAL super modules
Bool_t fUseExternalMatrices; // Use the matrices set in fkSModuleMatrix and not those in the geoManager
static const Char_t *fgkDefaultGeometryName; // Default name of geometry
- ClassDef(AliEMCALGeometry,16) // EMCAL geometry class
+ ClassDef(AliEMCALGeometry,17) // EMCAL geometry class
} ;
static void Titles(TH1 *hid=0, const char *titx="",const char *tity="");
static TList* CreateProjectionsX(TList *l=0, const Int_t ind=2, const Char_t* name="prox");
- static TLatex *Lat(const char *text="", Float_t x=0.0,Float_t y=0.0, Int_t align=12, Float_t tsize=0.05, short tcolor = 1);
+ static TLatex *Lat(const char *text="", Float_t x=0.0,Float_t y=0.0, Int_t align=22, Float_t tsize=0.05, short tcolor = 1);
static TGraph *DrawGraph(Int_t n=4, Double_t *x=0, Double_t *y=0, Int_t markerColor=4,
Int_t markerStyle=4, const char* opt="", const char* tit="", const char* xTit=" jet E_{t} ",
const char* yTit="", Int_t ifun=0, const char *optFit="W+", const char *fun="");
const int kReturnCodeNoObject = 2;
const int kReturnCodeNoEntries = 1;
-const int kNTRU = 32; // From 2012; 10 + 2/3 SuperModules (SM) * 3 TRU per SM
+const int kNTRU = 62; // EMCAL (10 SM + 2/3) + (DCAL 10 SM) * 3 TRU per SM
ClassImp(AliEMCALPreprocessor)
fRawAnalyzer(0),
fRawAnalyzerTRU(0),
fGeom(0),
- fSuperModules(12), // FIXME!!! number of SuperModules; 12 for 2012; update default for later runs
+ fSuperModules(22), // FIXME!!! number of SuperModules; updated to 22 for DCal
fFirstPedestalSample(0),
fLastPedestalSample(3),
fFirstPedestalSampleTRU(0),
fRawAnalyzerTRU->SetFixTau(kTRUE);
fRawAnalyzerTRU->SetTau(2.5); // default for TRU shaper
- fGeom = new AliEMCALGeometry("EMCAL_COMPLETE12SMV1", "EMCAL");
+ fGeom = new AliEMCALGeometry("EMCAL_COMPLETE12SMV1_DCAL", "EMCAL");
// for (Int_t sm = 0 ; sm < fSuperModules ; sm++){
// fTextSM[sm] = NULL ;
// }
return;
}
- static const Int_t nDDL = 12*2; // 12 SM hardcoded for now. Buffers allocated dynamically, when needed, so just need an upper limit here
+ static const Int_t nDDL = 22*2; // 22 SM for DCal hardcoded for now. Buffers allocated dynamically, when needed, so just need an upper limit here
AliAltroBuffer* buffers[nDDL];
for (Int_t i=0; i < nDDL; i++)
buffers[i] = 0;
TArrayI adcValuesHigh( TIMEBINS );
// loop over digits (assume ordered digits)
- for (Int_t iDigit = 0; iDigit < digits->GetEntries(); iDigit++)
- {
- AliEMCALDigit* digit = dynamic_cast<AliEMCALDigit *>(digits->At(iDigit)) ;
- if(!digit)
- {
- AliFatal("NULL Digit");
- }
- else
- {
- if (digit->GetAmplitude() < AliEMCALRawResponse::GetRawFormatThreshold() )
- {
- continue;
- }
- //get cell indices
- Int_t nSM = 0;
- Int_t nIphi = 0;
- Int_t nIeta = 0;
- Int_t iphi = 0;
- Int_t ieta = 0;
- Int_t nModule = 0;
- fGeom->GetCellIndex(digit->GetId(), nSM, nModule, nIphi, nIeta);
- fGeom->GetCellPhiEtaIndexInSModule(nSM, nModule, nIphi, nIeta,iphi, ieta) ;
+ for (Int_t iDigit = 0; iDigit < digits->GetEntries(); iDigit++) {
+ AliEMCALDigit* digit = dynamic_cast<AliEMCALDigit *>(digits->At(iDigit)) ;
+ if(!digit) {
+ AliFatal("NULL Digit");
+ } else {
+ if (digit->GetAmplitude() < AliEMCALRawResponse::GetRawFormatThreshold() ) {
+ continue;
+ }
+ //get cell indices
+ Int_t nSM = 0;
+ Int_t nIphi = 0;
+ Int_t nIeta = 0;
+ Int_t iphi = 0;
+ Int_t ieta = 0;
+ Int_t nModule = 0;
+ fGeom->GetCellIndex(digit->GetId(), nSM, nModule, nIphi, nIeta);
+ fGeom->GetCellPhiEtaIndexInSModule(nSM, nModule, nIphi, nIeta,iphi, ieta) ;
+
+ //Check which is the RCU, 0 or 1, of the cell.
+ Int_t iRCU = -111;
+ if (0<=iphi&&iphi<8) iRCU=0; // first cable row
+ else if (8<=iphi&&iphi<16 && 0<=ieta&&ieta<24) iRCU=0; // first half;
+ else if(8<=iphi&&iphi<16 && 24<=ieta&&ieta<48) iRCU=1; // second half;
+ //second cable row
+ else if(16<=iphi&&iphi<24) iRCU=1; // third cable row
- //Check which is the RCU, 0 or 1, of the cell.
- Int_t iRCU = -111;
- if (0<=iphi&&iphi<8) iRCU=0; // first cable row
- else if (8<=iphi&&iphi<16 && 0<=ieta&&ieta<24) iRCU=0; // first half;
- else if(8<=iphi&&iphi<16 && 24<=ieta&&ieta<48) iRCU=1; // second half;
- //second cable row
- else if(16<=iphi&&iphi<24) iRCU=1; // third cable row
-
- if (nSM%2==1) iRCU = 1 - iRCU; // swap for odd=C side, to allow us to cable both sides the same
-
- if (iRCU<0)
- Fatal("Digits2Raw()","Non-existent RCU number: %d", iRCU);
+ if (nSM%2==1) iRCU = 1 - iRCU; // swap for odd=C side, to allow us to cable both sides the same
- //Which DDL?
- Int_t iDDL = NRCUSPERMODULE*nSM + iRCU;
- if (iDDL < 0 || iDDL >= nDDL){
- Fatal("Digits2Raw()","Non-existent DDL board number: %d", iDDL);
- }
- else{
- if (buffers[iDDL] == 0)
- {
- // open new file and write dummy header
- TString fileName = AliDAQ::DdlFileName("EMCAL",iDDL);
- //Select mapping file RCU0A, RCU0C, RCU1A, RCU1C
+ if (iRCU<0)
+ Fatal("Digits2Raw()","Non-existent RCU number: %d", iRCU);
+
+ //Which DDL?
+ Int_t iDDL = NRCUSPERMODULE*nSM + iRCU;
+ if (iDDL < 0 || iDDL >= nDDL){
+ Fatal("Digits2Raw()","Non-existent DDL board number: %d", iDDL);
+ } else {
+ if (buffers[iDDL] == 0) {
+ // open new file and write dummy header
+ TString fileName = AliDAQ::DdlFileName("EMCAL",iDDL);
+ //Select mapping file RCU0A, RCU0C, RCU1A, RCU1C
Int_t iRCUside=iRCU+(nSM%2)*2;
//iRCU=0 and even (0) SM -> RCU0A.data 0
//iRCU=1 and even (0) SM -> RCU1A.data 1
//iRCU=0 and odd (1) SM -> RCU0C.data 2
//iRCU=1 and odd (1) SM -> RCU1C.data 3
- buffers[iDDL] = new AliAltroBuffer(fileName.Data(),fMapping[iRCUside]);
+ buffers[iDDL] = new AliAltroBuffer(fileName.Data(),fMapping[iRCUside]);
buffers[iDDL]->WriteDataHeader(kTRUE, kFALSE); //Dummy;
}
buffers[iDDL]->WriteTrailer(3, ieta, iphi, nSM); // trailer
// calculate the time response function
} else {
- Bool_t lowgain = AliEMCALRawResponse::RawSampledResponse(digit->GetTimeR(), digit->GetAmplitude(),
- adcValuesHigh.GetArray(), adcValuesLow.GetArray()) ;
-
- if (lowgain)
+ Bool_t lowgain = AliEMCALRawResponse::RawSampledResponse(digit->GetTimeR(), digit->GetAmplitude(),
+ adcValuesHigh.GetArray(), adcValuesLow.GetArray()) ;
+
+ if (lowgain)
buffers[iDDL]->WriteChannel(ieta, iphi, 0, TIMEBINS, adcValuesLow.GetArray(), AliEMCALRawResponse::GetRawFormatThreshold() );
else
buffers[iDDL]->WriteChannel(ieta,iphi, 1, TIMEBINS, adcValuesHigh.GetArray(), AliEMCALRawResponse::GetRawFormatThreshold() );
}
//Check rows/phi
- if (iSM < 10) {
- if (iphi >= fNCellsFromEMCALBorder && iphi < 24-fNCellsFromEMCALBorder) okrow =kTRUE;
- } else if (iSM >=10 && ( ( geom->GetEMCGeometry()->GetGeoName()).Contains("12SMV1"))) {
- if (iphi >= fNCellsFromEMCALBorder && iphi < 8-fNCellsFromEMCALBorder) okrow =kTRUE; //1/3 sm case
- } else {
- if (iphi >= fNCellsFromEMCALBorder && iphi < 12-fNCellsFromEMCALBorder) okrow =kTRUE; // half SM case
- }
+ Int_t iPhiLast = 24;
+ if( geom->GetSMType(iSM) == AliEMCALGeometry::kEMCAL_Half ) iPhiLast /= 2;
+ else if ( geom->GetSMType(iSM) == AliEMCALGeometry::kEMCAL_3rd ) iPhiLast /= 3;// 1/3 sm case
+ if(iphi >= fNCellsFromEMCALBorder && iphi < iPhiLast - fNCellsFromEMCALBorder) okrow = kTRUE;
+
//Check columns/eta
- if (!fNoEMCALBorderAtEta0) {
- if (ieta > fNCellsFromEMCALBorder && ieta < 48-fNCellsFromEMCALBorder) okcol =kTRUE;
+ Int_t iEtaLast = 48;
+ if(!fNoEMCALBorderAtEta0 || geom->IsDCALSM(iSM)) {// conside inner border
+ if( geom->GetSMType(iSM) == AliEMCALGeometry::kDCAL_Standard ) iEtaLast = iEtaLast*2/3;
+ if(ieta > fNCellsFromEMCALBorder && ieta < iEtaLast-fNCellsFromEMCALBorder) okcol = kTRUE;
} else {
if (iSM%2==0) {
- if (ieta >= fNCellsFromEMCALBorder) okcol = kTRUE;
+ if (ieta >= fNCellsFromEMCALBorder) okcol = kTRUE;
} else {
- if (ieta < 48-fNCellsFromEMCALBorder) okcol = kTRUE;
+ if(ieta < iEtaLast-fNCellsFromEMCALBorder) okcol = kTRUE;
}
}//eta 0 not checked
//Init temporary list of digits
fgDigitsArr = new TClonesArray("AliEMCALDigit",1000);
fgClustersArr = new TObjArray(1000);
- fgTriggerDigits = new TClonesArray("AliEMCALTriggerRawDigit", 32 * 96);
+
+ const int kNTRU = fGeom->GetNTotalTRU();
+ fgTriggerDigits = new TClonesArray("AliEMCALTriggerRawDigit", kNTRU * 96);
//Track matching
fMatches = new TList();
if(fgDigitsArr) fgDigitsArr->Clear("C");
- TClonesArray *digitsTrg = new TClonesArray("AliEMCALTriggerRawDigit", 32 * 96);
+ const int kNTRU = fGeom->GetNTotalTRU();
+ TClonesArray *digitsTrg = new TClonesArray("AliEMCALTriggerRawDigit", kNTRU * 96);
Int_t bufsize = 32000;
digitsTree->Branch("EMCAL", &fgDigitsArr, bufsize);
fgRawUtils->SetRemoveBadChannels(GetRecParam()->GetRemoveBadChannels());
if (!fgRawUtils->GetFittingAlgorithm()) fgRawUtils->SetFittingAlgorithm(GetRecParam()->GetFittingAlgorithm());
fgRawUtils->SetFALTROUsage(GetRecParam()->UseFALTRO());
-
+ // fgRawUtils->SetFALTROUsage(0);
+
//fgRawUtils->SetTimeMin(GetRecParam()->GetTimeMin());
//fgRawUtils->SetTimeMax(GetRecParam()->GetTimeMax());
const Int_t bufsize = 255;
char path[bufsize] ;
TGeoHMatrix * m = 0x0;
+ Int_t tmpType = -1;
+ Int_t SMOrder = 0;
+ TString SMName;
for(Int_t sm = 0; sm < fGeom->GetNumberOfSuperModules(); sm++){
- snprintf(path,bufsize,"/ALIC_1/XEN1_1/SMOD_%d",sm+1) ; //In Geometry modules numbered 1,2,.,5
- if(sm >= 10 && !((fGeom->GetEMCGeometry()->GetGeoName()).Contains("12SMV1"))) snprintf(path,bufsize,"/ALIC_1/XEN1_1/SM10_%d",sm-10+1) ;
- if(sm >= 10 && ((fGeom->GetEMCGeometry()->GetGeoName()).Contains("12SMV1"))) snprintf(path,bufsize,"/ALIC_1/XEN1_1/SM3rd_%d",sm-10+1) ;
-
+ if(fGeom->GetSMType(sm) == AliEMCALGeometry::kEMCAL_Standard ) SMName = "SMOD";
+ else if(fGeom->GetSMType(sm) == AliEMCALGeometry::kEMCAL_Half ) SMName = "SM10";
+ else if(fGeom->GetSMType(sm) == AliEMCALGeometry::kEMCAL_3rd ) SMName = "SM3rd";
+ else if( fGeom->GetSMType(sm) == AliEMCALGeometry::kDCAL_Standard ) SMName = "DCSM";
+ else if( fGeom->GetSMType(sm) == AliEMCALGeometry::kDCAL_Ext ) SMName = "DCEXT";
+ else AliError("Unkown SM Type!!");
+
+ if(fGeom->GetSMType(sm) == tmpType) {
+ SMOrder++;
+ } else {
+ tmpType = fGeom->GetSMType(sm);
+ SMOrder = 1;
+ }
+ snprintf(path,bufsize,"/ALIC_1/XEN1_1/%s_%d", SMName.Data(), SMOrder) ;
+
if (gGeoManager->CheckPath(path)){
gGeoManager->cd(path);
m = gGeoManager->GetCurrentMatrix() ;
// pitch, yaw angles of each installed SM.
//
// J.L. Klay - Cal Poly
+// Adapted for DCAL by M.L. Wang CCNU & Subatech Oct-19-2012
// 21-May-2010
//
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
AliAlignObjParams* myobj = 0x0;
+ TString SMName;
+ Int_t tmpType = -1;
+ Int_t SMOrder = 0;
+
for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
- TString smodName(TString::Format("EMCAL/FullSupermodule%d", smodnum+1));
- if(geom->GetKey110DEG() && smodnum >= 10) {
- smodName = "EMCAL/HalfSupermodule";
- smodName += (smodnum-10+1);
- }
+ if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Standard ) SMName = "FullSupermodule";
+ else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half ) SMName = "HalfSupermodule";
+ else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd ) SMName = "OneThrdSupermodule";
+ else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard ) SMName = "DCALSupermodule";
+ else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) SMName = "DCALExtensionSM";
+ else AliError("Unkown SM Type!!");
+
+ if(geom->GetSMType(smodnum) == tmpType) {
+ SMOrder++;
+ } else {
+ tmpType = geom->GetSMType(smodnum);
+ SMOrder = 1;
+ }
+
+ TString smodName(TString::Format("EMCAL/%s%d", SMName.Data(), SMOrder));
AliEMCALSuperModuleDelta t(GetSuperModuleTransformation(smodnum));
///////////////////////////////
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
+ TString SMName;
+ Int_t tmpType = -1;
+ Int_t SMOrder = 0;
+
for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
- TString smodName(TString::Format("EMCAL/FullSupermodule%d", smodnum+1));
- if(geom->GetKey110DEG() && smodnum >= 10) {
- smodName = "EMCAL/HalfSupermodule";
- smodName += (smodnum-10+1);
+ if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Standard ) SMName = "FullSupermodule";
+ else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half ) SMName = "HalfSupermodule";
+ else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd ) SMName = "OneThrdSupermodule";
+ else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard ) SMName = "DCALSupermodule";
+ else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) SMName = "DCALExtensionSM";
+ else AliError("Unkown SM Type!!");
+
+ if(geom->GetSMType(smodnum) == tmpType) {
+ SMOrder++;
+ } else {
+ tmpType = geom->GetSMType(smodnum);
+ SMOrder = 1;
}
+ TString smodName(TString::Format("EMCAL/%s%d", SMName.Data(), SMOrder));
+
new(array[arrayInd]) AliAlignObjParams(smodName.Data(), volid, 0., 0., 0., 0., 0., 0., true);
++arrayInd;
}
//Center of supermodules
Float_t pars[] = {geom->GetSuperModulesPar(0),geom->GetSuperModulesPar(1),geom->GetSuperModulesPar(2)};
Double_t rpos = (geom->GetEnvelop(0) + geom->GetEnvelop(1))/2.;
+ Float_t fInnerEdge = geom->GetDCALInnerEdge();
Double_t phi=0, phiRad=0, xpos=0, ypos=0, zpos=0;
AliEMCALSuperModuleCoords *idealSM = new AliEMCALSuperModuleCoords[fNSuperModule];
for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
AliEMCALSuperModuleCoords &smc = idealSM[smodnum];
- phiRad = geom->GetPhiCenterOfSM(smodnum); //comes in radians
+ phiRad = geom->GetPhiCenterOfSMSec(smodnum); //comes in radians
phi = phiRad*180./TMath::Pi(); //need degrees for AliAlignObjParams
xpos = rpos * TMath::Cos(phiRad);
ypos = rpos * TMath::Sin(phiRad);
zpos = pars[2];
- if(geom->GetKey110DEG() && smodnum >= 10) {
+ if( geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half
+ || geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd
+ || geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) {
xpos += (pars[1]/2. * TMath::Sin(phiRad));
ypos -= (pars[1]/2. * TMath::Cos(phiRad));
+ } else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard) {
+ zpos = pars[2] + fInnerEdge/2.;
}
+
smc.fX1 = xpos;
smc.fY1 = ypos;
smc.fPhi = phi; //degrees
//Center of supermodules
Float_t pars[] = {geom->GetSuperModulesPar(0),geom->GetSuperModulesPar(1),geom->GetSuperModulesPar(2)};
Double_t rpos = (geom->GetEnvelop(0) + geom->GetEnvelop(1))/2.;
+ Float_t fInnerEdge = geom->GetDCALInnerEdge();
Double_t phi=0, phiRad=0, xpos=0, ypos=0, zpos=0;
zpos = pars[2];
AliEMCALSuperModuleCoords *idealSM = new AliEMCALSuperModuleCoords[fNSuperModule];
for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
AliEMCALSuperModuleCoords &smc = idealSM[smodnum];
- phiRad = geom->GetPhiCenterOfSM(smodnum); //comes in radians
+ phiRad = geom->GetPhiCenterOfSMSec(smodnum); //comes in radians
phi = phiRad*180./TMath::Pi(); //need degrees for AliAlignObjParams
xpos = rpos * TMath::Cos(phiRad);
ypos = rpos * TMath::Sin(phiRad);
- if(geom->GetKey110DEG() && smodnum >= 10) {
+
+ if( geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half
+ || geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd
+ || geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) {
xpos += (pars[1]/2. * TMath::Sin(phiRad));
ypos -= (pars[1]/2. * TMath::Cos(phiRad));
+ } else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard) {
+ zpos = pars[2] + fInnerEdge/2.;
}
+
smc.fX1 = xpos;
smc.fY1 = ypos;
if(!ampmatrixes) return kFALSE;
// Get matrix of TRU or Module with maximum amplitude patch.
- Int_t itru = mtru + iSM * fGeom->GetNTRU(); //number of tru, min 0 max 3*12=36.
+ Int_t itru = mtru + iSM * fGeom->GetNTRU(); //number of tru, min 0 max 3*22=66.
TMatrixD * ampmatrix = 0x0;
Int_t colborder = 0;
Int_t rowborder = 0;
AliFatal("Did not get geometry from EMCALLoader");
//Define parameters
- Int_t nSuperModules = fGeom->GetNumberOfSuperModules() ; //12 SM in EMCAL
+ Int_t nSuperModules = fGeom->GetNumberOfSuperModules() ; //12 SM in EMCAL and 6/10 DCAL SMs
Int_t nTRU = fGeom->GetNTRU(); // 3 TRU per super module
//Intialize data members each time the trigger is called in event loop
//
// AliEMCALTriggerDCSConfig default constructor
//
- fTRUArr = new TClonesArray("AliEMCALTriggerTRUDCSConfig",32);
+ fTRUArr = new TClonesArray("AliEMCALTriggerTRUDCSConfig",62);
fSTUObj = new AliEMCALTriggerSTUDCSConfig();
}
namespace
{
- const Int_t kNTRU = 32;
+ const Int_t kNTRU = 32; // TODO: kNTRU should be set to / replaced by fGeometry->GetNTotalTRU() (total number of TRU for a given geom) after adding 1 STU for DCAL
}
ClassImp(AliEMCALTriggerElectronics)
// 32 TRUs
for (Int_t i = 0; i < kNTRU; i++) {
+ if(i>=(fGeometry->GetNTotalTRU())) continue; // i <= kNTRU < 62. Prevents fTRU to go out of bonds with EMCALFirstYEARV1 of EMCALCompleteV1 (NTRU<32) TODO: fix the logic
AliEMCALTriggerTRUDCSConfig *truConf = dcsConf->GetTRUDCSConfig(fGeometry->GetOnlineIndexFromTRUIndex(i));
if (truConf) new ((*fTRU)[i]) AliEMCALTriggerTRU(truConf, rSize, i % 2);
}
if (isOK1 && isOK2 && amp) {
AliDebug(999, Form("=== TRU# %2d ADC# %2d time# %2d signal %d ===", iTRU, iADC, time, amp));
-
+ if(iTRU>32) continue; // kNTRU < iTRU < 62. Prevents fTRU to go out of bonds with DCAL TODO: add STU for DCAL and fix the logic
AliEMCALTriggerTRU * etr = (static_cast<AliEMCALTriggerTRU*>(fTRU->At(iTRU)));
if (etr) {
if (data->GetMode())
fRawAnalyzer = (AliCaloRawAnalyzerFakeALTRO*)AliCaloRawAnalyzerFactory::CreateAnalyzer(kFakeAltro);
fDCSConfig = AliEMCALTriggerDCSConfigDB::Instance();
-
- for (Int_t i=0; i<3072; i++) fRawDigitIndex[i] = -1;
+
+ Int_t nRawDigits = fGeometry->GetNTotalTRU() * 96;
+ for (Int_t i=0; i<nRawDigits; i++) fRawDigitIndex[i] = -1;
}
//_______________
{
if (AliDebugLevel()) printf("| STU => TRU raw data are there!\n");
- for (Int_t i = 0; i < 32; i++)
+ Int_t nTRU = fGeometry->GetNTotalTRU();
+ for (Int_t i = 0; i < nTRU; i++)
{
iTRU = fGeometry->GetTRUIndexFromSTUIndex(i);
{
// Reset
- for (Int_t i = 0; i < 3072; i++) fRawDigitIndex[i] = -1;
+ Int_t nRawDigits = fGeometry->GetNTotalTRU() * 96;
+ for (Int_t i = 0; i < nRawDigits; i++) fRawDigitIndex[i] = -1;
}
AliEMCALTriggerDCSConfigDB* fDCSConfig; // DCS config
AliEMCALTriggerData* fTriggerData; // Trigger data
- Int_t fRawDigitIndex[3072]; // Raw digit indexes
+ Int_t fRawDigitIndex[5952]; // Raw digit indexes
private:
//*-- Author: Yves Schutz (SUBATECH)
//*-- and : Sahal Yacoob (LBL / UCT)
// : Alexei Pavlinov (WSU) SHASHLYK
-
+// : Adapted for DCAL by M.L. Wang CCNU & Subatech Oct-19-2012
// --- ROOT system ---
#include <cassert>
AliEMCALv0::AliEMCALv0()
: AliEMCAL(),
fShishKebabModules(),fEnvelop1(0),fIdRotm(0),fIdTmedArr(0),
- fSampleWidth(0),fSmodPar0(0),fSmodPar1(0),fSmodPar2(0),fCalFrame(0)
+ fSampleWidth(0),fSmodPar0(0),fSmodPar1(0),fSmodPar2(0),
+ fInnerEdge(0),fCalFrame(0)
{
//default ctor
for(Int_t i = 0; i < 5 ; i++) fParEMOD[i]=0.0;
const Bool_t checkGeoAndRun)
: AliEMCAL(name,title,checkGeoAndRun),
fShishKebabModules(),fEnvelop1(0),fIdRotm(0),fIdTmedArr(0),
- fSampleWidth(0),fSmodPar0(0),fSmodPar1(0),fSmodPar2(0),fCalFrame(0)
+ fSampleWidth(0),fSmodPar0(0),fSmodPar1(0),fSmodPar2(0),
+ fInnerEdge(0),fCalFrame(0)
{
// ctor : title is used to identify the layout
// Apr 25, 2006
} else {
envelopA[0] = geom->GetArm1PhiMin(); // minimum phi angle
envelopA[1] = geom->GetArm1PhiMax() - geom->GetArm1PhiMin(); // angular range in phi
- envelopA[2] = geom->GetNPhiSuperModule(); // number of sections in phi
- envelopA[3] = 2; // 2 z coordinates
+ envelopA[2] = envelopA[1]/geom->GetEMCGeometry()->GetPhiSuperModule(); // Section of that
+ envelopA[3] = 2; // 2: z coordinates
envelopA[4] = -geom->GetEnvelop(2)/2.; // zmin - includes padding
envelopA[5] = geom->GetEnvelop(0) ; // rmin at z1 - includes padding
envelopA[6] = geom->GetEnvelop(1) ; // rmax at z1 - includes padding
CreateSmod(g->GetNameOfEMCALEnvelope());
- CreateEmod("SMOD","EMOD"); // 18-may-05
+ Int_t * SMTypeList = g->GetEMCSystem();
+ Int_t tmpType = -1;
+ for(int i = 0 ; i < g->GetNumberOfSuperModules(); i++) {
+ if( SMTypeList[i] == tmpType) continue;
+ else tmpType = SMTypeList[i];
+
+ if( tmpType == AliEMCALGeometry::kEMCAL_Standard ) CreateEmod("SMOD","EMOD"); // 18-may-05
+ else if( tmpType == AliEMCALGeometry::kEMCAL_Half ) CreateEmod("SM10","EMOD"); // Nov 1,2006 1/2 SM
+ else if( tmpType == AliEMCALGeometry::kEMCAL_3rd ) CreateEmod("SM3rd","EMOD"); // Feb 1,2012 1/3 SM
+ else if( tmpType == AliEMCALGeometry::kDCAL_Standard ) CreateEmod("DCSM","EMOD"); // Mar 13, 2012, 6 or 10 DCSM
+ else if( tmpType == AliEMCALGeometry::kDCAL_Ext ) CreateEmod("DCEXT","EMOD"); // Mar 13, 2012, DCAL extension SM
+ else AliError("Unkown SM Type!!");
+ }
- if(g->GetKey110DEG() && !gn.Contains("12SMV1")) { CreateEmod("SM10","EMOD");} // Nov 1,2006 1/2 SM
- if(g->GetKey110DEG() && gn.Contains("12SMV1")) { CreateEmod("SM3rd","EMOD"); } // Feb 1,2012 1/3 SM
-
// Sensitive SC (2x2 tiles)
double parSCM0[5]={0,0,0,0}, *dummy = 0, parTRAP[11];
//______________________________________________________________________
void AliEMCALv0::CreateSmod(const char* mother)
{
- // 18-may-05; mother="XEN1";
- // child="SMOD" from first to 10th, "SM10" (11th and 12th) (TRD1 case)
+ // 18-may-05; mother="XEN1";
+ // child="SMOD" from first to 10th, "SM10" (11th and 12th)
+ // "DCSM" from 13th to 18/22th (TRD1 case), "DCEXT"(18th and 19th) adapted for DCAL, Oct-23-2012
AliEMCALGeometry * g = GetGeometry();
TString gn(g->GetName()); gn.ToUpper();
Double_t par[3], xpos=0., ypos=0., zpos=0., rpos=0., dphi=0., phi=0.0, phiRad=0.;
- Double_t par1C = 0.;
+ Double_t parC[3] = {0};
+ TString smName;
+ Int_t tmpType = -1;
+
// ===== define Super Module from air - 14x30 module ==== ;
AliDebug(2,Form("\n ## Super Module | fSampleWidth %5.3f ## %s \n", fSampleWidth, gn.Data()));
par[0] = g->GetShellThickness()/2.;
par[1] = g->GetPhiModuleSize()*g->GetNPhi()/2.;
- par[2] = g->GetEtaModuleSize()*15.;
+ par[2] = g->GetEtaModuleSize()*g->GetNEta()/2.;
fIdRotm=0;
- int nphism = g->GetNumberOfSuperModules()/2; // 20-may-05
- if(nphism>0) {
- dphi = (g->GetArm1PhiMax() - g->GetArm1PhiMin())/nphism;
- // if(g->GetKey110DEG()) dphi = (g->GetArm1PhiMax() - g->GetArm1PhiMin())/(nphism-1);
+ Int_t nSMod = g->GetNumberOfSuperModules();
+ int nphism = nSMod/2; // 20-may-05
+ if(nphism > 0) {
+ dphi = g->GetEMCGeometry()->GetPhiSuperModule();
rpos = (g->GetEnvelop(0) + g->GetEnvelop(1))/2.;
AliDebug(2,Form(" rpos %8.2f : dphi %6.1f degree \n", rpos, dphi));
}
if(gn.Contains("WSUC")) {
+ int nr=0;
par[0] = g->GetPhiModuleSize()*g->GetNPhi()/2.;
par[1] = g->GetShellThickness()/2.;
par[2] = g->GetEtaModuleSize()*g->GetNZ()/2. + 5;
fSmodPar1 = par[1];
fSmodPar2 = par[2];
nphism = g->GetNumberOfSuperModules();
- } else {
- par[2] = 350./2.; // 11-oct-04 - for 26 division
- AliDebug(2,Form(" par[0] %7.2f (old) \n", par[0]));
- Float_t parSM[] = {g->GetSuperModulesPar(0),g->GetSuperModulesPar(1),g->GetSuperModulesPar(2)};
- for(int i=0; i<3; i++) par[i] = parSM[i];
- }
- gMC->Gsvolu("SMOD", "BOX", fIdTmedArr[kIdAIR], par, 3);
- AliDebug(2,Form("tmed %i | dx %7.2f dy %7.2f dz %7.2f (SMOD, BOX)\n",
- fIdTmedArr[kIdAIR], par[0],par[1],par[2]));
- fSmodPar0 = par[0];
- fSmodPar2 = par[2];
- if(g->GetKey110DEG() && !gn.Contains("12SMV1") ) { // 12-oct-05
- par1C = par[1];
- par[1] /= 2.;
- gMC->Gsvolu("SM10", "BOX", fIdTmedArr[kIdAIR], par, 3);
- AliDebug(2,Form(" Super module with name \"SM10\" was created too par[1] = %f\n", par[1]));
- par[1] = par1C;
- }
- if(g->GetKey110DEG() && gn.Contains("12SMV1")) { // 1-feb-12, one third (installed in 2012) case
- par1C = par[1];
- par[1] /= 3.;
- gMC->Gsvolu("SM3rd", "BOX", fIdTmedArr[kIdAIR], par, 3);
- AliDebug(2,Form(" Super module with name \"SM3rd\" was created too par[1] = %f\n", par[1]));
- par[1] = par1C;
- }
-
- // Steel plate
- if(g->GetSteelFrontThickness() > 0.0) { // 28-mar-05
- par[0] = g->GetSteelFrontThickness()/2.;
- gMC->Gsvolu("STPL", "BOX", fIdTmedArr[kIdSTEEL], par, 3);
- printf("tmed %i | dx %7.2f dy %7.2f dz %7.2f (STPL) \n", fIdTmedArr[kIdSTEEL], par[0],par[1],par[2]);
- xpos = -(g->GetShellThickness() - g->GetSteelFrontThickness())/2.;
- gMC->Gspos("STPL", 1, "SMOD", xpos, 0.0, 0.0, 0, "ONLY") ;
- }
-
- int nr=0, nrsmod=0, i0=0;
-
- // Turn whole super module
- for(int i=i0; i<nphism; i++) {
- if(gn.Contains("WSUC")) {
+ for(int i=0; i<nphism; i++) {
xpos = ypos = zpos = 0.0;
fIdRotm = 0;
gMC->Gspos("SMOD", 1, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
printf(" fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f \n",
fIdRotm, phi, phiRad, xpos, ypos, zpos);
nr++;
- } else { // TRD1
- TString smName("SMOD"); // 12-oct-05
- if(i==5 && g->GetKey110DEG() && !gn.Contains("12SMV1")) {
- smName = "SM10";
- nrsmod = nr;
- nr = 0;
- }
- if(i==5 && g->GetKey110DEG() && gn.Contains("12SMV1")) {
- smName = "SM3rd";
- nrsmod = nr;
- nr = 0;
+ }
+ } else {// ALICE
+ AliDebug(2,Form(" par[0] %7.2f (old) \n", par[0]));
+ for(int i=0; i<3; i++) par[i] = g->GetSuperModulesPar(i);
+ fSmodPar0 = par[0];
+ fSmodPar2 = par[2];
+ Int_t SMOrder = -1;
+ tmpType = -1;
+ for (Int_t smodnum = 0; smodnum < nSMod; ++smodnum) {
+ for(int i=0; i<3; i++) parC[i] = par[i];
+ if(g->GetSMType(smodnum) == tmpType) {
+ SMOrder++;
+ } else {
+ tmpType = g->GetSMType(smodnum);
+ SMOrder = 1;
}
- phi = g->GetArm1PhiMin() + dphi*(2*i+1)/2.; // phi= 70, 90, 110, 130, 150, 170
- phiRad = phi*TMath::Pi()/180.;
- AliMatrix(fIdRotm, 90.0, phi, 90.0, 90.0+phi, 0.0, 0.0);
+ phiRad = g->GetPhiCenterOfSMSec(smodnum); // NEED phi= 90, 110, 130, 150, 170, 190(not center)...
+ phi = phiRad *180./TMath::Pi();
+ Double_t phiy = 90. + phi;
+ Double_t phiz = 0.;
xpos = rpos * TMath::Cos(phiRad);
ypos = rpos * TMath::Sin(phiRad);
zpos = fSmodPar2; // 21-sep-04
- if(i==5 && g->GetKey110DEG() && !gn.Contains("12SMV1") ) {
- xpos += (par1C/2. * TMath::Sin(phiRad));
- ypos -= (par1C/2. * TMath::Cos(phiRad));
+ if( tmpType == AliEMCALGeometry::kEMCAL_Standard ) {
+ smName="SMOD";
+ } else if( tmpType == AliEMCALGeometry::kEMCAL_Half ) {
+ smName="SM10";
+ parC[1] /= 2.;
+ xpos += (par[1]/2. * TMath::Sin(phiRad));
+ ypos -= (par[1]/2. * TMath::Cos(phiRad));
+ } else if( tmpType == AliEMCALGeometry::kEMCAL_3rd ) {
+ smName="SM3rd";
+ parC[1] /= 3.;
+ xpos += (2.*par[1]/3. * TMath::Sin(phiRad));
+ ypos -= (2.*par[1]/3. * TMath::Cos(phiRad));
+ } else if( tmpType == AliEMCALGeometry::kDCAL_Standard ) {
+ smName="DCSM";
+ parC[2] *= 2./3.;
+ zpos = fSmodPar2 + g->GetDCALInnerEdge()/2.; // 21-sep-04
+ } else if( tmpType == AliEMCALGeometry::kDCAL_Ext ) {
+ smName="DCEXT";
+ parC[1] /= 3.;
+ xpos += (2.*par[1]/3. * TMath::Sin(phiRad));
+ ypos -= (2.*par[1]/3. * TMath::Cos(phiRad));
+ } else AliError("Unkown SM Type!!");
+
+ if(SMOrder == 1) {//first time, create the SM
+ gMC->Gsvolu(smName.Data(), "BOX", fIdTmedArr[kIdAIR], parC, 3);
+ AliDebug(2,Form(" Super module with name \"%s\" was created in \"box\" with: par[0] = %f, par[1] = %f, par[2] = %f\n", smName.Data(), parC[0], parC[1], parC[2]));
}
- if(i==5 && g->GetKey110DEG() && gn.Contains("12SMV1") ) {
- xpos += (2.*par1C/3. * TMath::Sin(phiRad));
- ypos -= (2.*par1C/3. * TMath::Cos(phiRad));
+
+ if( smodnum%2 == 1) {
+ phiy += 180.;
+ if(phiy>=360.) phiy -= 360.;
+ phiz = 180.;
+ zpos *= -1.;
}
-
- // 1th module in z-direction;
- gMC->Gspos(smName.Data(), ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
- AliDebug(3, Form(" %s : %2i fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : i %i \n",
- smName.Data(), nr, fIdRotm, phi, phiRad, xpos, ypos, zpos, i));
- // 2th module in z-direction;
- // turn arround X axis; 0<phi<360
- double phiy = 90. + phi + 180.;
- if(phiy>=360.) phiy -= 360.;
-
- AliMatrix(fIdRotm, 90.0, phi, 90.0, phiy, 180.0, 0.0);
- gMC->Gspos(smName.Data(), ++nr, mother, xpos, ypos, -zpos, fIdRotm, "ONLY");
- AliDebug(3, Form(" %s : %2i fIdRotm %3i phiy %6.1f xpos %7.2f ypos %7.2f zpos %7.2f \n",
- smName.Data(), nr, fIdRotm, phiy, xpos, ypos, -zpos));
+ AliMatrix(fIdRotm, 90.0, phi, 90.0, phiy, phiz, 0.0);
+ gMC->Gspos(smName.Data(), SMOrder, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
+ AliDebug(3, Form(" %s : %2i, fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : i %i \n",
+ smName.Data(), SMOrder, fIdRotm, phi, phiRad, xpos, ypos, zpos, smodnum));
}
}
- AliDebug(2,Form(" Number of Super Modules %i \n", nr+nrsmod));
+ AliDebug(2,Form(" Number of Super Modules %i \n", nSMod));
+
+ // Steel plate
+ if(g->GetSteelFrontThickness() > 0.0) { // 28-mar-05
+ par[0] = g->GetSteelFrontThickness()/2.;
+ gMC->Gsvolu("STPL", "BOX", fIdTmedArr[kIdSTEEL], par, 3);
+ printf("tmed %i | dx %7.2f dy %7.2f dz %7.2f (STPL) \n", fIdTmedArr[kIdSTEEL], par[0],par[1],par[2]);
+ xpos = -(g->GetShellThickness() - g->GetSteelFrontThickness())/2.;
+ gMC->Gspos("STPL", 1, "SMOD", xpos, 0.0, 0.0, 0, "ONLY") ;
+ }
}
//______________________________________________________________________
zpos = mod->GetPosZ() - fSmodPar2;
int iyMax = g->GetNPhi();
- if(strcmp(mother,"SMOD") && g->GetKey110DEG() && !gn.Contains("12SMV1") ) {
+ if(strcmp(mother,"SM10") == 0 ) {
iyMax /= 2;
- }
- if(strcmp(mother,"SMOD") && g->GetKey110DEG() && gn.Contains("12SMV1") ) {
+ } else if(strcmp(mother,"SM3rd") == 0 ) {
iyMax /= 3;
- }
+ } else if(strcmp(mother,"DCEXT") == 0 ) {
+ iyMax /= 3;
+ } else if(strcmp(mother,"DCSM") == 0 ) {
+ if(iz < 8 ) continue;//!!!DCSM from 8th to 23th
+ zpos = mod->GetPosZ() - fSmodPar2 - g->GetDCALInnerEdge()/2.;
+ } else if(strcmp(mother,"SMOD") != 0 )
+ AliError("Unknown super module Type!!");
for(int iy=0; iy<iyMax; iy++) { // flat in phi
- ypos = g->GetPhiModuleSize()*(2*iy+1 - iyMax)/2.;
- gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
- //
- //printf(" %2i xpos %7.2f ypos %7.2f zpos %7.2f fIdRotm %i\n", nr, xpos, ypos, zpos, fIdRotm);
- AliDebug(3,Form("%3.3i(%2.2i,%2.2i) ", nr,iy+1,iz+1));
+ ypos = g->GetPhiModuleSize()*(2*iy+1 - iyMax)/2.;
+ gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
+ //
+ //printf(" %2i xpos %7.2f ypos %7.2f zpos %7.2f fIdRotm %i\n", nr, xpos, ypos, zpos, fIdRotm);
+ AliDebug(3,Form("%3.3i(%2.2i,%2.2i) ", nr,iy+1,iz+1));
}
//PH printf("\n");
} else { //WSUC
- if(iz==0) AliMatrix(fIdRotm, 0.,0., 90.,0., 90.,90.); // (x')z; y'(x); z'(y)
- else AliMatrix(fIdRotm, 90-angle,270., 90.0,0.0, angle,90.);
+ if(iz == 0) AliMatrix(fIdRotm, 0.,0., 90.,0., 90.,90.); // (x')z; y'(x); z'(y)
+ else AliMatrix(fIdRotm, 90-angle,270., 90.0,0.0, angle,90.);
phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi();
//printf(" %2i | angle -phiOK | %6.3f - %6.3f = %6.3f(eta %5.3f)\n",
//iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule());
//printf(" zpos %7.2f ypos %7.2f fIdRotm %i\n xpos ", zpos, xpos, fIdRotm);
for(int ix=0; ix<g->GetNPhi(); ix++)
{ // flat in phi
- xpos = g->GetPhiModuleSize()*(2*ix+1 - g->GetNPhi())/2.;
- gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
- printf(" %7.2f ", xpos);
+ xpos = g->GetPhiModuleSize()*(2*ix+1 - g->GetNPhi())/2.;
+ gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
+ printf(" %7.2f ", xpos);
}
printf("\n");
}
Int_t modUID, modnum = 0;
TString volpath, symname;
- Int_t nSMod = GetGeometry()->GetNumberOfSuperModules();
- for (Int_t smodnum=0; smodnum < nSMod; smodnum++) {
- modUID = AliGeomManager::LayerToVolUID(idEMCAL,modnum++);
- volpath = "ALIC_1/XEN1_1/SMOD_";
- volpath += (smodnum+1);
- symname = "EMCAL/FullSupermodule";
- symname += (smodnum+1);
+ AliEMCALGeometry * geom = GetGeometry();
+ Int_t nSMod = geom->GetNumberOfSuperModules();
+ TString SMPathName;
+ TString SMName;
+ Int_t tmpType = -1;
+ Int_t SMOrder = 0;
- if(GetGeometry()->GetKey110DEG() && smodnum>=10 && !( ( GetGeometry()->GetEMCGeometry()->GetGeoName()).Contains("12SMV1")) )
- {
- volpath = "ALIC_1/XEN1_1/SM10_";
- volpath += (smodnum-10+1);
- symname = "EMCAL/HalfSupermodule";
- symname += (smodnum-10+1);
- }
-
- if(GetGeometry()->GetKey110DEG() && smodnum>=10 && ( ( GetGeometry()->GetEMCGeometry()->GetGeoName()).Contains("12SMV1")) )
- {
- volpath = "ALIC_1/XEN1_1/SM3rd_";
- volpath += (smodnum-10+1);
- symname = "EMCAL/OneThrdSupermodule";
- symname += (smodnum-10+1);
+ for (Int_t smodnum = 0; smodnum < nSMod; ++smodnum) {
+ modUID = AliGeomManager::LayerToVolUID(idEMCAL,modnum++);
+ if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Standard ) { SMPathName = "SMOD"; SMName = "FullSupermodule";}
+ else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half ) { SMPathName = "SM10"; SMName = "HalfSupermodule";}
+ else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd ) { SMPathName = "SM3rd"; SMName = "OneThrdSupermodule";}
+ else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard ) { SMPathName = "DCSM"; SMName = "DCALSupermodule";}
+ else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) { SMPathName = "DCEXT"; SMName = "DCALExtensionSM";}
+ else AliError("Unkown SM Type!!");
+
+ if(geom->GetSMType(smodnum) == tmpType) {
+ SMOrder++;
+ } else {
+ tmpType = geom->GetSMType(smodnum);
+ SMOrder = 1;
}
+ volpath.Form("ALIC_1/XEN1_1/%s_%d",SMPathName.Data(), SMOrder);
+ symname.Form("EMCAL/%s%d",SMName.Data(), SMOrder);
+
if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
- AliFatal("AliEMCALv0::Unable to set alignable entry!!");
+ AliFatal(Form("AliEMCALv0::Unable to set alignable entry!!\nName: %s\t Path: %s\t ModuleID: %d\n",symname.Data(),volpath.Data(), modUID));
// Creates the Tracking to Local transformation matrix for EMCAL
// modules
xpos = rpos * TMath::Cos(phiRad);
ypos = rpos * TMath::Sin(phiRad);
zpos = pars[2];
- if(GetGeometry()->GetKey110DEG() && smodnum >= 10 && !( ( GetGeometry()->GetEMCGeometry()->GetGeoName()).Contains("12SMV1")))
- {
- AliDebug(3, Form(" fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : smodnum %i \n",
- fIdRotm, phi, phiRad, xpos, ypos, zpos, smodnum));
+ if( geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half ) {
xpos += (pars[1]/2. * TMath::Sin(phiRad)); // half SM!
ypos -= (pars[1]/2. * TMath::Cos(phiRad));
- }
-
- if(GetGeometry()->GetKey110DEG() && smodnum >= 10 && ( ( GetGeometry()->GetEMCGeometry()->GetGeoName()).Contains("12SMV1")))
- {
- AliDebug(3, Form(" fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : smodnum %i \n",
- fIdRotm, phi, phiRad, xpos, ypos, zpos, smodnum));
+ } else if ( geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd || geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) {
xpos += (pars[1]/3. * TMath::Sin(phiRad)); // one_third SM !
ypos -= (pars[1]/3. * TMath::Cos(phiRad));
+ } else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard ) {
+ zpos = pars[2]*2./3. + GetGeometry()->GetDCALInnerEdge()/2.;
}
-
+
+ AliDebug(3, Form(" fIdRotm %3i phi %6.13f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : smodnum %i \n",
+ fIdRotm, phi, phiRad, xpos, ypos, zpos, smodnum));
+
TGeoHMatrix *matTtoL;
TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig();
if(smodnum%2 == 0) {
- // pozitive z
- TGeoTranslation geoTran0(xpos,ypos, zpos);
+ // pozitive z
+ TGeoTranslation geoTran0(xpos, ypos, zpos);
TGeoRotation geoRot0("geoRot0", 90.0, phi, 90.0, 90.0+phi, 0.0, 0.0);
TGeoCombiTrans mat0(geoTran0, geoRot0);
matTtoL = new TGeoHMatrix(mat0);
// Implementation version v0 of EMCAL Manager class
// An object of this class does not produce hits nor digits
// It is the one to use if you do not want to produce outputs in TREEH or TREED
-// This class places a Geometry of the EMCAL in the ALICE Detector as defined in AliEMCALGeometry.cxx
+// This class places a Geometry of the EMCAL in the ALICE Detector as defined in AliEMCALGeometry.cxx
//*-- Author: Yves Schutz (SUBATECH)
//*-- and : Sahal Yacoob (LBL / UCT)
// : Aleksei Pavlinov (WSU) SHASHLYK
Double_t fSmodPar0; //! x size of super module
Double_t fSmodPar1; //! y size of super module
Double_t fSmodPar2; //! z size of super module
+ Double_t fInnerEdge; //! Inner edge of DCAL super module
Double_t fParEMOD[5]; //! parameters of EMCAL module (TRD1,2)
AliEMCALSpaceFrame* fCalFrame; //EMCAL Space frame object
//*-- It is the one to use if you do want to produce outputs in TREEH
//*--
//*-- Author : Alexei Pavlinov (WSU)
-
+// : Adapted for DCAL by M.L. Wang CCNU Wuhan & Subatech Oct-23-2012
// 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.
static int supModuleNumber=-1, moduleNumber=-1, yNumber=-1, xNumber=-1, absid=-1;
static int keyGeom=1; //real TRD1 geometry
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(keyGeom == 0) {
//TParticle *part=gAlice->GetMCApp()->Particle(parent);
parent=tracknumber;
part=gAlice->GetMCApp()->Particle(parent);
- while (parent != -1 && fGeometry->IsInEMCAL(part->Vx(),part->Vy(),part->Vz())) {
+ while (parent != -1 && fGeometry->IsInEMCALOrDCAL(part->Vx(),part->Vy(),part->Vz())) {
parent=part->GetFirstMother();
if (parent!=-1)
part=gAlice->GetMCApp()->Particle(parent);
gMC->CurrentVolOffID(3, moduleNumber);
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
+ Int_t CurrentSMType = 0;
+ if(strcmp(gMC->CurrentVolOffName(4),"SMOD")==0) CurrentSMType = AliEMCALGeometry::kEMCAL_Standard ;
+ else if(strcmp(gMC->CurrentVolOffName(4),"SM10")==0) CurrentSMType = AliEMCALGeometry::kEMCAL_Half ;
+ else if(strcmp(gMC->CurrentVolOffName(4),"SM3rd")==0) CurrentSMType = AliEMCALGeometry::kEMCAL_3rd ;
+ else if(strcmp(gMC->CurrentVolOffName(4),"DCSM")==0) CurrentSMType = AliEMCALGeometry::kDCAL_Standard ;
+ else if(strcmp(gMC->CurrentVolOffName(4),"DCEXT")==0) CurrentSMType = AliEMCALGeometry::kDCAL_Ext ;
+ else AliError("Unkown SM Type!!");
+
+ Int_t preSM = 0;
+ while( fGeometry->GetSMType(preSM) != CurrentSMType ) preSM++;
+ supModuleNumber += preSM;
// Nov 10,2006
if(strcmp(gMC->CurrentVolOffName(0),vn) != 0) { // 3X3 case
if (strcmp(gMC->CurrentVolOffName(0),"SCX1")==0) xNumber=1;
gMC->CurrentVolOffID(4, moduleNumber);
gMC->CurrentVolOffID(1, yNumber);
gMC->CurrentVolOffID(0, xNumber);
- if (strcmp(gMC->CurrentVolOffName(5),"SMOP")==0) supModuleNumber = nSMOP[supModuleNumber-1];
- else if(strcmp(gMC->CurrentVolOffName(5),"SMON")==0) supModuleNumber = nSMON[supModuleNumber-1];
+ if (strcmp(gMC->CurrentVolOffName(5),"SMOP")==0) supModuleNumber = 2*(supModuleNumber-1)+1;
+ else if(strcmp(gMC->CurrentVolOffName(5),"SMON")==0) supModuleNumber = 2*(supModuleNumber-1)+2;
else assert(0); // something wrong
}
Int_t smType = 1;
fGeometry->GetCellPhiEtaIndexInSModule(smNumber,moduleNumber-1,yNumber-1,xNumber-1, iphi, ieta);
if (smNumber%2 == 0) {
- ieta = ((fGeometry->GetCentersOfCellsEtaDir()).GetSize()-1)-ieta;// 47-ieta, revert the ordering on A side in order to keep convention.
- }
- else {
- 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.
+ if(strcmp(gMC->CurrentVolOffName(4),"DCSM")==0) smType = 3; //DCal supermodule. previous design/idea
+ else smType = 2;
+ ieta = ((fGeometry->GetCentersOfCellsEtaDir()).GetSize()* 2/smType -1)-ieta;// 47/31-ieta, revert the ordering on A side in order to keep convention.
+ } else {
+ if(strcmp(gMC->CurrentVolOffName(4),"SM10")==0) smType = 2 ; //half supermodule. previous design/idea
+ if(strcmp(gMC->CurrentVolOffName(4),"SM3rd")==0) smType = 3 ; //one third (installed in 2012) supermodule
+ if(strcmp(gMC->CurrentVolOffName(4),"DCEXT")==0) smType = 3 ; //one third (installed in 2012) supermodule
+ iphi= ((fGeometry->GetCentersOfCellsPhiDir()).GetSize()/smType-1)-iphi;// 23/7-iphi, revert the ordering on C side in order to keep convention.
}
//Once we know the indexes, calculate the absolute ID
-void MakeEMCALResMisAlignment(TString geoname = "EMCAL_COMPLETE12SMV1"){
+void MakeEMCALResMisAlignment(TString geoname = "EMCAL_COMPLETE12SMV1_DCAL_8SM"){
// Create TClonesArray of residual misalignment objects for EMCAL
//
const char* macroname = "MakeEMCALResMisAlignment.C";
Double_t dx, dy, dz, dpsi, dtheta, dphi;
- const TString basepath = "EMCAL/FullSupermodule";
+ const TString fbasepath = "EMCAL/FullSupermodule";
const TString hbasepath = "EMCAL/HalfSupermodule";
+ const TString tbasepath = "EMCAL/OneThrdSupermodule";
+ const TString dbasepath = "EMCAL/DCALSupermodule";
+ const TString debasepath= "EMCAL/DCALExtensionSM";
TString pathstr;
Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
Int_t i;
- Int_t j=0;
// RS = local
// sigma translation = 1mm
Double_t sigmatr = 0.05; // max shift in cm w.r.t. local RS
Double_t sigmarot = 0.1; // max rot in degrees w.r.t. local RS
- for(i=0; i<10; i++){
+ Int_t nSM = emcalGeom->GetEMCGeometry()->GetNumberOfSuperModules();
+ for(i=0; i<nSM; i++){
dx = rnd->Gaus(0.,sigmatr);
dy = rnd->Gaus(0.,sigmatr);
dz = rnd->Gaus(0.,sigmatr);
dpsi = rnd->Gaus(0.,sigmarot);
dtheta = rnd->Gaus(0.,sigmarot);
dphi = rnd->Gaus(0.,sigmarot);
- pathstr=basepath;
+ if( emcalGeom->GetSMType(i) == kEMCAL_Standard) pathstr=fbasepath;
+ else if(emcalGeom->GetSMType(i) == kEMCAL_Half ) pathstr=hbasepath;
+ else if(emcalGeom->GetSMType(i) == kEMCAL_3rd ) pathstr=tbasepath;
+ else if(emcalGeom->GetSMType(i) == kDCAL_Standard ) pathstr=dbasepath;
+ else if(emcalGeom->GetSMType(i) == kDCAL_Ext ) pathstr=debasepath;
pathstr+=(i+1);
- new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
- }
-
- for(i=0; i<2; i++){
- dx = rnd->Gaus(0.,sigmatr);
- dy = rnd->Gaus(0.,sigmatr);
- dz = rnd->Gaus(0.,sigmatr);
- dpsi = rnd->Gaus(0.,sigmarot);
- dtheta = rnd->Gaus(0.,sigmarot);
- dphi = rnd->Gaus(0.,sigmarot);
- pathstr=hbasepath;
- pathstr+=(i+1);
- new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[i]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
}
if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
-void MakeEMCALZeroMisAlignment(TString geoname = "EMCAL_COMPLETE12SMV1"){
+void MakeEMCALZeroMisAlignment(TString geoname = "EMCAL_COMPLETE12SMV1_DCAL_8SM"){
// Create TClonesArray of zero misalignment objects for EMCAL
//
const char* macroname = "MakeEMCALZeroMisAlignment.C";
#include "AliRun.h"
#include "AliEMCALCalibData.h"
+#include "AliEMCALGeoParams.h"
#include "AliCDBMetaData.h"
#include "AliCDBId.h"
#include "AliCDBEntry.h"
if (flag == 0) {
DBFolder ="local://InitCalibDB";
firstRun = 0;
- lastRun = 0;
+ lastRun = 999999999;
objFormat = "EMCAL initial gain factors and pedestals";
}
else if (flag == 1) {
Float_t cc=0, ped;
TRandom rn;
- Int_t nSMod = 12;
- Int_t nCol = 48;
- Int_t nRow = 24;
- Int_t nRow2 = 12; //Modules 11 and 12 are half modules
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
- for(Int_t supermodule=0; supermodule < nSMod; supermodule++) {
+ for(Int_t supermodule=0; supermodule < nSMod; supermodule++) {
+ Int_t nCol = AliEMCALGeoParams::fgkEMCALCols;
+ Int_t nRow = AliEMCALGeoParams::fgkEMCALRows;
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11)//not good solution
+ nCol = nCol*2/3;
for(Int_t column=0; column< nCol; column++) {
- if(supermodule >= 10)
- nRow = nRow2;
for(Int_t row=0; row< nRow; row++) {
cc = fADCchannel;
ped = fADCpedestal;
->Get("EMCAL/Calib/Data",
gAlice->GetRunNumber())->GetObject());
- static const Int_t nSMod = 12;
- static const Int_t nCol = 48;
- Int_t nRow = 24;
- Int_t nRow2 = 12; //Modules 11 and 12 are half modules
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules;
Int_t nCC = 0;
TH2F *hPed[nSMod], *hGain[nSMod];
cout<<endl;
for (Int_t supermodule=0; supermodule<nSMod; supermodule++) {
+ Int_t nCol = AliEMCALGeoParams::fgkEMCALCols;
+ Int_t nRow = AliEMCALGeoParams::fgkEMCALRows;
- if(supermodule >= 10)
- nRow = nRow2;
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11)
+ nCol = nCol*2/3;
TString namePed="hPed";
namePed+=supermodule;
printf("MAP entries %d\n",map.GetEntries());
- AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1");
+ AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1_DCAL_8SM");
Int_t nbadTotal = 0;
Int_t nhotTotal = 0;
TString GetESDFileName() const {return fESDFileName;}
void Clear(Option_t* = "");
enum {kNPHOSMatrix = 5};
- enum {kNEMCALMatrix = 12};
+ enum {kNEMCALMatrix = 22};
enum {kT0SpreadSize = 4};
void SetVZEROEqFactors(const Float_t* factors) {
enum {kNTriggerClasses = 50};
enum {kNPHOSMatrix = 5};
- enum {kNEMCALMatrix = 12};
+ enum {kNEMCALMatrix = 22};
enum {kT0spreadSize = 4};
//
Double_t GetMeanIntensity(int beam,int btp) const
5, 5, // PHOS,CPV
7, // HMPID ??
1, // MUON ??
- 12 // EMCAL
+ 22 // EMCAL and DCAL
};
const char* AliGeomManager::fgLayerName[kLastLayer - kFirstLayer] = {
// Check over the ten EMCAL full supermodules and the two EMCAL half supermodules
TString emcalSM;
- TString baseEmcalSM("ALIC_1/XEN1_1/SM");
+ TString baseEmcalSM("ALIC_1/XEN1_1/");
Bool_t emcalActive=kFALSE;
- Bool_t emcalSMs[12] = {kFALSE};
- for(Int_t sm=0; sm<12; sm++)
+ Bool_t emcalSMs[22] = {kFALSE};
+ for(Int_t sm=0; sm<22; sm++)
{
emcalSM=baseEmcalSM;
if(sm<10){
- emcalSM += "OD_";
- emcalSM += (sm+1);
- }else{
- emcalSM += "10_";
- emcalSM += (sm-9);
+ emcalSM += "SMOD_";
+ emcalSM += (sm+1);
+ }else if(sm/2 == 5){
+ emcalSM += "SM10_";
+ emcalSM += (sm-9);
+ }else if(sm > 11){
+ emcalSM += "DCSM_";
+ emcalSM += (sm-11);
}
if(fgGeometry->CheckPath(emcalSM.Data()))
{
TString str = "EMCAL/FullSupermodule";
modnum=0;
- for (Int_t iModule=1; iModule <= 12; iModule++) {
- if(!emcalSMs[iModule-1]) continue;
+ for (Int_t iModule=0; iModule < 22; iModule++) {
+ if(!emcalSMs[iModule]) continue;
symname = str;
- symname += iModule;
- if(iModule >10) {
+ symname += iModule+1;
+ if(iModule/2 == 5) {// 10,11
symname = "EMCAL/HalfSupermodule";
- symname += iModule-10;
+ symname += iModule-9;
+ }else if(iModule > 11) {// 12 ~ 21
+ symname = "EMCAL/DCALSupermodule";
+ symname += iModule-11;
}
- modnum = iModule-1;
+ modnum = iModule;
uid = LayerToVolUID(kEMCAL,modnum);
pne = fgGeometry->GetAlignableEntryByUID(uid);
if(!pne)