// -*- Mode: C++ -*- //------------------------------------------------------------------------------ // File: Cal.cc // Author: Pasha Murat, Jodi Lamoureux // Creation: Oct 20, 1997 // // // revision history: // ----------------- // *0001 Feb 23 1997 P.Murat: add Used flag // *0002 Feb 27 1997 M.Shapiro, P.Murat: introduce detector set name // *0003 Mar 14 1997 P.Murat: new hangling of tracking medii // *0004 Mar 17 1997 P.Murat: `Used' flag defines level of geometry details // *0005 Apr 27 1997 M.Shapiro Add CEM, CHA and dead scintillator // *0006 Aug 04 1997 M.Shapiro Fix problem with dead scintillator // *0007 Oct 20 1997 J.Lamoureux: Setup calorimetery to run off of TYRBOS // *0008 Oct 25 1997 J.Lamoureux: Comment out Towers.print() // *0009 Nov 7 1997 J.Lamorueux: Add functionality for reconstruction // *0010 Nov 17 1997 J.Lamoureux: Fill the map array in init(anEvent) // *0011 Nov 30 1997 J.Lamoureux: make ieta range from 1 to TENETA // *0012 Dec 04 1997 P.Murat: change fmodf(x) -->fmod(double(x)) // *0013 Dec 5 1997 J.Lamoureux: fmod(double(x)) --> fmod(x) // *0014 Dec 10 1997 J.Lamoureux: annLoc.init_loc changed to read vertex. // *0015 Dec 12 1997 J.Lamoureux: Always use TRY_Record_Iter_Same. // *0016 Dec 13 1997 J.Lamoureux: Add cleanup for simulation. // *0017 Dec 16 1997 J.Lamoureux: Use Z=0 for simulation: initEvent(). // *0018 Jan 8 1998 J.Lamoureux: Remove dependence on the vertex. // *0019 Jan 23 1998 J.Lamoureux: use AbsEvent instead of CDF_EVENT // *0020 Feb 8 1998 J.Lamoureux: add calls to getCalibConsts() and TOWEtoD() // *0021 Feb 8 1998 M.Shapiro: by default, turn off TOWEtoD() // *0022 Feb 21 1998 J.Lamoureux- find_towe_data(anEvent) removed // *0023 Mar 20 1998 J.Lamoureux- Take bank making out of Cal class. // *0024 Apr 17 1998 J.Lamoureux- Make CAL into a registry of Cal geometries // *0025 May 1 1998 J.Lamoureux- add delete DETECTOR_TOWER_BOUNDARIES // *0026 May 21 1998 J.Lamoureux- move static map to instance method // *0027 Sep 12 1998 J.Lamoureux- add include file CalParameters.hh (why?) //----------------------------------------------------------------------------- /* #ifdef __GNUG__ #pragma implementation #endif //-------------------------------------------------------------------------- // *********************** CAL class methods ******************* //-------------------------------------------------------------------------- #include #include #if defined(DEFECT_NO_STDLIB_NAMESPACES) // Do Nothing #else // Standard C++ using std::find; #endif #include #include #if defined(DEFECT_NO_STDLIB_NAMESPACES) // Do Nothing #else // Standard C++ using std::map; #endif #include #if defined(DEFECT_NO_STDLIB_NAMESPACES) // Do Nothing #else // Standard C++ using std::less; #endif #include "inc/bcs.h" #include "Calor/Cal2.hh" #include "CalorGeometry/CalConstants.hh" #include "CalorGeometry/CalParameters.hh" // #include "Calor/TOWE_Bank_Driver.hh" #ifdef USE_ROOT_ ClassImp(CAL2) #endif CAL2* Cal2; static map > CalMap; //_____________________________________________________________________________ CAL2::CAL2() { // detAnnLoc = new DETECTOR_TOWER_BOUNDARIES; // towe = NULL; init(); } //_____________________________________________________________________________ CAL2::~CAL2() { // delete detAnnLoc; // if (towe) delete towe; } //_____________________________________________________________________________ void CAL2::init() { // global initialization routine: the calorimeter is used if any of its // sub-detectors (Central, Plug and Wall) is used Used = 0; // by default turn the miniplug off Miniplug.setUsed(0); if ( Central.used()>0 || Plug.used()>0 || Wall.used()>0 || Miniplug.used()>0) { Used = 1; } // choose the level of detail in // the simulation Level = 1; Level_geom = 1; } //------------------------------------------------------------------- // getCal(): returns a pointer to a particular instance of CAL2 // identified by a character string like "default". //------------------------------------------------------------------- CAL2* CAL2::instance(string type) { // Keep a well defined list of // geometries - each identified by a // char string like "default", // or "newSurvey". map >::iterator iter; iter = CalMap.find(type); if (iter!=CalMap.end()) { Cal2 = (*iter).second; } else { Cal2 = new CAL2; CalMap[type] = Cal2; } return Cal2; } //_____________________________________________________________________________ void CAL2::DoCleanup() { map >::iterator iter; CAL2* cal; for (iter=CalMap.begin(); iter != CalMap.end(); iter++) { cal = (*iter).second; delete cal; } // in the end reset pointer to CAL2 // thing to NULL Cal2 = NULL; } //_____________________________________________________________________________ //int CAL2::addSimEnergy(const float* x, float energy) { // useless for the moment // return 0; //} */