00001 //------------------------------------------------- 00002 // 00003 // Class: DTSCTrigUnit.cpp 00004 // 00005 // Description: Muon Barrel Trigger Unit (Chamber trigger) 00006 // 00007 // 00008 // Author List: 00009 // C. Grandi 00010 // Modifications: 00011 // 09/01/07 C. Battilana : moved to local conf 00012 // 30/03/07 SV : configuration through DTConfigManager 00013 // 00014 //-------------------------------------------------- 00015 00016 //----------------------- 00017 // This Class's Header -- 00018 //----------------------- 00019 #include "L1Trigger/DTSectorCollector/interface/DTSCTrigUnit.h" 00020 00021 //------------------------------- 00022 // Collaborating Class Headers -- 00023 //------------------------------- 00024 00025 00026 //--------------- 00027 // C++ Headers -- 00028 //--------------- 00029 #include <iostream> 00030 #include <cmath> 00031 00032 //---------------- 00033 // Constructors -- 00034 //---------------- 00035 DTSCTrigUnit::DTSCTrigUnit(DTChamber *stat) { 00036 00037 // DTChamberId chambid = stat->id(); 00038 // bool geom_debug = conf_manager->getDTConfigTrigUnit(chambid)->debug(); 00039 00040 // create the geometry from the station 00041 //_geom = new DTTrigGeom(stat, geom_debug); 00042 _geom = new DTTrigGeom(stat, false); // CB FIXME: update when debug will be read via PSet 00043 00044 // create BTI 00045 _theBTIs = new DTBtiCard(_geom); 00046 00047 // create TSTheta 00048 _theTSTheta = new DTTSTheta(_geom, _theBTIs); 00049 00050 // create TRACO 00051 _theTRACOs = new DTTracoCard(_geom, _theBTIs, _theTSTheta); 00052 00053 // create TSPhi 00054 _theTSPhi = new DTTSPhi(_geom, _theTRACOs); 00055 00056 } 00057 00058 00059 //-------------- 00060 // Destructor -- 00061 //-------------- 00062 DTSCTrigUnit::~DTSCTrigUnit(){ 00063 delete _theBTIs; 00064 delete _theTRACOs; 00065 delete _theTSPhi; 00066 delete _theTSTheta; 00067 delete _geom; 00068 } 00069 00070 DTGeomSupplier* 00071 DTSCTrigUnit::GeomSupplier(const DTTrigData* trig) const { 00072 //@@ patch for Sun 4.2 compiler 00073 DTTrigData* tr = const_cast<DTTrigData*>(trig); 00074 if(dynamic_cast<DTBtiTrigData*>(tr))return _theBTIs; 00075 if(dynamic_cast<DTTracoTrigData*>(tr))return _theTRACOs; 00076 if(dynamic_cast<DTChambPhSegm*>(tr))return _theTSPhi; 00077 if(dynamic_cast<DTChambThSegm*>(tr))return _theTSTheta; 00078 // if(dynamic_cast<const DTBtiTrigData*>(trig))return _theBTIs; 00079 // if(dynamic_cast<const DTTracoTrigData*>(trig))return _theTRACOs; 00080 // if(dynamic_cast<const DTChambPhSegm*>(trig))return _theTSPhi; 00081 // if(dynamic_cast<const DTChambThSegm*>(trig))return _theTSTheta; 00082 return 0; 00083 } 00084 00085 void DTSCTrigUnit::setConfig(const DTConfigManager *conf){ 00086 00087 _theBTIs->setConfig(conf); 00088 _theTSTheta->setConfig(conf); 00089 _theTRACOs->setConfig(conf); 00090 _theTSPhi->setConfig(conf); 00091 00092 } 00093 00094 00095 00096 00097