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 #include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h" 00025 00026 00027 //--------------- 00028 // C++ Headers -- 00029 //--------------- 00030 #include <iostream> 00031 #include <cmath> 00032 00033 //---------------- 00034 // Constructors -- 00035 //---------------- 00036 DTSCTrigUnit::DTSCTrigUnit(DTChamber *stat, DTTTrigBaseSync *sync) { 00037 00038 DTChamberId chambid = stat->id(); 00039 // bool geom_debug = conf_manager->getDTConfigTrigUnit(chambid)->debug(); 00040 00041 // create the geometry from the station 00042 //_geom = new DTTrigGeom(stat, geom_debug); 00043 _geom = new DTTrigGeom(stat, false); // CB FIXME: update when debug will be read via PSet 00044 00045 // create BTI 00046 _theBTIs = new DTBtiCard(_geom, sync); 00047 00048 // create TSTheta 00049 _theTSTheta = new DTTSTheta(_geom, _theBTIs); 00050 00051 // create TRACO 00052 _theTRACOs = new DTTracoCard(_geom, _theBTIs, _theTSTheta); 00053 00054 // create TSPhi 00055 _theTSPhi = new DTTSPhi(_geom, _theTRACOs); 00056 00057 } 00058 00059 00060 //-------------- 00061 // Destructor -- 00062 //-------------- 00063 DTSCTrigUnit::~DTSCTrigUnit(){ 00064 delete _theBTIs; 00065 delete _theTRACOs; 00066 delete _theTSPhi; 00067 delete _theTSTheta; 00068 delete _geom; 00069 } 00070 00071 DTGeomSupplier* 00072 DTSCTrigUnit::GeomSupplier(const DTTrigData* trig) const { 00073 //@@ patch for Sun 4.2 compiler 00074 DTTrigData* tr = const_cast<DTTrigData*>(trig); 00075 if(dynamic_cast<DTBtiTrigData*>(tr))return _theBTIs; 00076 if(dynamic_cast<DTTracoTrigData*>(tr))return _theTRACOs; 00077 if(dynamic_cast<DTChambPhSegm*>(tr))return _theTSPhi; 00078 if(dynamic_cast<DTChambThSegm*>(tr))return _theTSTheta; 00079 // if(dynamic_cast<const DTBtiTrigData*>(trig))return _theBTIs; 00080 // if(dynamic_cast<const DTTracoTrigData*>(trig))return _theTRACOs; 00081 // if(dynamic_cast<const DTChambPhSegm*>(trig))return _theTSPhi; 00082 // if(dynamic_cast<const DTChambThSegm*>(trig))return _theTSTheta; 00083 return 0; 00084 } 00085 00086 void DTSCTrigUnit::setConfig(const DTConfigManager *conf){ 00087 00088 _theBTIs->setConfig(conf); 00089 _theTSTheta->setConfig(conf); 00090 _theTRACOs->setConfig(conf); 00091 _theTSPhi->setConfig(conf); 00092 00093 } 00094 00095 00096 00097 00098