Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:58

0001 //-------------------------------------------------
0002 //
0003 //   Class: DTSCTrigUnit.cpp
0004 //
0005 //   Description: Muon Barrel Trigger Unit (Chamber trigger)
0006 //
0007 //
0008 //   Author List:
0009 //   C. Grandi
0010 //   Modifications:
0011 //   09/01/07 C. Battilana : moved to local conf
0012 //   30/03/07 SV : configuration through DTConfigManager
0013 //
0014 //--------------------------------------------------
0015 
0016 //-----------------------
0017 // This Class's Header --
0018 //-----------------------
0019 #include "L1Trigger/DTSectorCollector/interface/DTSCTrigUnit.h"
0020 
0021 //-------------------------------
0022 // Collaborating Class Headers --
0023 //-------------------------------
0024 
0025 //---------------
0026 // C++ Headers --
0027 //---------------
0028 #include <iostream>
0029 #include <cmath>
0030 
0031 //----------------
0032 // Constructors --
0033 //----------------
0034 DTSCTrigUnit::DTSCTrigUnit(const DTChamber* stat) {
0035   // DTChamberId chambid = stat->id();
0036   // bool geom_debug = conf_manager->getDTConfigTrigUnit(chambid)->debug();
0037 
0038   // create the geometry from the station
0039   //_geom = new DTTrigGeom(stat, geom_debug);
0040   _geom = new DTTrigGeom(stat, false);  // CB FIXME: update when debug will be read via PSet
0041 
0042   // create BTI
0043   _theBTIs = new DTBtiCard(_geom);
0044 
0045   // create TSTheta
0046   _theTSTheta = new DTTSTheta(_geom, _theBTIs);
0047 
0048   // create TRACO
0049   _theTRACOs = new DTTracoCard(_geom, _theBTIs, _theTSTheta);
0050 
0051   // create TSPhi
0052   _theTSPhi = new DTTSPhi(_geom, _theTRACOs);
0053 }
0054 
0055 //--------------
0056 // Destructor --
0057 //--------------
0058 DTSCTrigUnit::~DTSCTrigUnit() {
0059   delete _theBTIs;
0060   delete _theTRACOs;
0061   delete _theTSPhi;
0062   delete _theTSTheta;
0063   delete _geom;
0064 }
0065 
0066 DTGeomSupplier* DTSCTrigUnit::GeomSupplier(const DTTrigData* trig) const {
0067   //@@ patch for Sun 4.2 compiler
0068   DTTrigData* tr = const_cast<DTTrigData*>(trig);
0069   if (dynamic_cast<DTBtiTrigData*>(tr))
0070     return _theBTIs;
0071   if (dynamic_cast<DTTracoTrigData*>(tr))
0072     return _theTRACOs;
0073   if (dynamic_cast<DTChambPhSegm*>(tr))
0074     return _theTSPhi;
0075   if (dynamic_cast<DTChambThSegm*>(tr))
0076     return _theTSTheta;
0077   //    if(dynamic_cast<const DTBtiTrigData*>(trig))return _theBTIs;
0078   //    if(dynamic_cast<const DTTracoTrigData*>(trig))return _theTRACOs;
0079   //    if(dynamic_cast<const DTChambPhSegm*>(trig))return _theTSPhi;
0080   //    if(dynamic_cast<const DTChambThSegm*>(trig))return _theTSTheta;
0081   return nullptr;
0082 }
0083 
0084 void DTSCTrigUnit::setConfig(const DTConfigManager* conf) {
0085   _theBTIs->setConfig(conf);
0086   _theTSTheta->setConfig(conf);
0087   _theTRACOs->setConfig(conf);
0088   _theTSPhi->setConfig(conf);
0089 }