CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

DTConfigManager Class Reference

#include <DTConfigManager.h>

List of all members.

Public Types

typedef std::map< DTChamberId,
innerBtiMap
BtiMap
typedef std::map< DTBtiId,
DTConfigBti
innerBtiMap
typedef std::map< DTTracoId,
DTConfigTraco
innerTracoMap
typedef std::map< DTChamberId,
DTConfigLUTs
LUTMap
typedef std::map< DTSectCollId,
DTConfigSectColl
SectCollMap
typedef std::map< DTChamberId,
innerTracoMap
TracoMap
typedef std::map< DTChamberId,
DTConfigTrigUnit
TrigUnitMap
typedef std::map< DTChamberId,
DTConfigTSPhi
TSPhiMap
typedef std::map< DTChamberId,
DTConfigTSTheta
TSThetaMap

Public Member Functions

 DTConfigManager ()
 Constructor.
void dumpLUTParam (DTChamberId &chambid) const
 SV 091111 Dump luts string commands from configuration parameters.
int getBXOffset () const
 Get BX Offset.
DTConfigBtigetDTConfigBti (DTBtiId) const
 Get desired BTI configuration.
const std::map< DTBtiId,
DTConfigBti > & 
getDTConfigBtiMap (DTChamberId) const
 Get desired BTI configuration map for a given DTChamber.
DTConfigLUTsgetDTConfigLUTs (DTChamberId) const
 Get desired LUT configuration.
DTConfigSectCollgetDTConfigSectColl (DTSectCollId) const
 Get desired SectorCollector configuration.
DTConfigTracogetDTConfigTraco (DTTracoId) const
 Get desired TRACO configuration.
const std::map< DTTracoId,
DTConfigTraco > & 
getDTConfigTracoMap (DTChamberId) const
 Get desired TRACO configuration map for a given DTChamber.
DTConfigTrigUnitgetDTConfigTrigUnit (DTChamberId) const
 Get desired Trigger Unit configuration.
DTConfigTSPhigetDTConfigTSPhi (DTChamberId) const
 Get desired Trigger Server Phi configuration.
DTConfigTSThetagetDTConfigTSTheta (DTChamberId) const
 Get desired Trigger Server Theta configuration.
bool getDTTPGDebug () const
 Get global debug flag.
bool lutFromDB () const
 Lut from DB flag.
void setDTConfigBti (DTBtiId, DTConfigBti)
 Set DTConfigBti for desired chip.
void setDTConfigLUTs (DTChamberId chambid, DTConfigLUTs conf)
 Set DTConfigLUTs for desired chamber.
void setDTConfigSectColl (DTSectCollId sectcollid, DTConfigSectColl conf)
 Set DTConfigSectColl for desired chip.
void setDTConfigTraco (DTTracoId, DTConfigTraco)
 Set DTConfigTraco for desired chip.
void setDTConfigTrigUnit (DTChamberId chambid, DTConfigTrigUnit conf)
 Set DTConfigTrigUnit for desired chamber.
void setDTConfigTSPhi (DTChamberId chambid, DTConfigTSPhi conf)
 Set DTConfigTSPhi for desired chip.
void setDTConfigTSTheta (DTChamberId chambid, DTConfigTSTheta conf)
 Set DTConfigTSTheta for desired chip.
void setDTTPGDebug (bool debug)
 SetGlobalDebug flag.
void setLutFromDB (bool lutFromDB)
 Set lut from DB flag.
void setUseAcceptParam (bool acceptparam)
 Set the use of Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
bool useAcceptParam () const
 Use Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
 ~DTConfigManager ()
 Destructor.

Private Attributes

bool m_acceptparam
bool m_lutfromdb
BtiMap my_btimap
int my_bxoffset
bool my_dttpgdebug
LUTMap my_lutmap
SectCollMap my_sectcollmap
TracoMap my_tracomap
TrigUnitMap my_trigunitmap
TSPhiMap my_tsphimap
TSThetaMap my_tsthetamap

Detailed Description

DTTPG Configuration manager Includes config classes for every single chip

Author:
C. Battilana april 07 : SV DTConfigTrigUnit added april 07 : CB Removed DTGeometry dependecies september 08 : SV LUTs added 091106 SV flags for DB/geometry lut or bti acceptance compute

Definition at line 48 of file DTConfigManager.h.


Member Typedef Documentation

Definition at line 54 of file DTConfigManager.h.

Definition at line 52 of file DTConfigManager.h.

Definition at line 53 of file DTConfigManager.h.

Definition at line 59 of file DTConfigManager.h.

Definition at line 60 of file DTConfigManager.h.

Definition at line 55 of file DTConfigManager.h.

Definition at line 58 of file DTConfigManager.h.

Definition at line 57 of file DTConfigManager.h.

Definition at line 56 of file DTConfigManager.h.


Constructor & Destructor Documentation

DTConfigManager::DTConfigManager ( )

Constructor.

Definition at line 40 of file DTConfigManager.cc.

                                {

}
DTConfigManager::~DTConfigManager ( )

Destructor.

Definition at line 48 of file DTConfigManager.cc.

                                 {

  my_sectcollmap.clear();
  my_trigunitmap.clear();
  my_tsphimap.clear();
  my_tsthetamap.clear();
  my_tracomap.clear();
  my_btimap.clear();

}

Member Function Documentation

void DTConfigManager::dumpLUTParam ( DTChamberId chambid) const

SV 091111 Dump luts string commands from configuration parameters.

Definition at line 239 of file DTConfigManager.cc.

References DTConfigLUTs::D(), makeHLTPrescaleTable::fout, DTConfigLUTs::IEEE32toDSP(), AlCaRecoCosmics_cfg::name, DTChamberId::sector(), DTChamberId::station(), DTConfigLUTs::Wheel(), DTChamberId::wheel(), and DTConfigLUTs::Xcn().

Referenced by DTTrig::dumpLuts().

                                                             {

  // open txt file
  string name = "Lut_from_param";
  name += ".txt";

  ofstream fout;
  fout.open(name.c_str(),ofstream::app);

  // get wheel, station, sector from chamber 
  int wh = chambid.wheel();
  int st = chambid.station();
  int se = chambid.sector();

  //cout << "Dumping lut command for wh " << wh << " st " << st << " se " << se << endl;

  fout << wh;
  fout << "\t" << st;
  fout << "\t" << se;

  // get parameters from configuration
  // get DTConfigLUTs for this chamber
  DTConfigLUTs* _confLUTs = getDTConfigLUTs(chambid);
  short int btic = getDTConfigTraco(DTTracoId(wh,st,se,1))->BTIC(); 
  float d = _confLUTs->D();
  float xcn = _confLUTs->Xcn();
  //fout << "\td\t" << d << "\txcn\t" << xcn << "\t"; 
  //fout << "btic\t" << btic << "\t";

  // *** dump TRACO LUT command
  fout << "\tA8";
  short int Low_byte = (btic & 0x00FF);   // output in hex bytes format with zero padding
  short int High_byte =( btic>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0') << Low_byte;

  // convert parameters from IEE32 float to DSP float format
  short int DSPmantissa = 0;
  short int DSPexp = 0;

  // d parameter conversion and dump
  _confLUTs->IEEE32toDSP(d, DSPmantissa, DSPexp);
  Low_byte = (DSPmantissa & 0x00FF);   // output in hex bytes format with zero padding
  High_byte =( DSPmantissa>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0') << Low_byte;
  Low_byte = (DSPexp & 0x00FF);
  High_byte =( DSPexp>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << High_byte << setw(2) << setfill('0') << Low_byte;

  // xnc parameter conversion and dump
  DSPmantissa = 0;
  DSPexp = 0;
  _confLUTs->IEEE32toDSP(xcn, DSPmantissa, DSPexp);
  Low_byte = (DSPmantissa & 0x00FF);   // output in hex bytes format with zero padding
  High_byte =( DSPmantissa>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0') << Low_byte;
  Low_byte = (DSPexp & 0x00FF);
  High_byte =( DSPexp>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << High_byte << setw(2) << setfill('0') << Low_byte;

  // sign bits
  short int xcn_sign = _confLUTs->Wheel();
  Low_byte = (xcn_sign & 0x00FF);   // output in hex bytes format with zero padding
  High_byte =( xcn_sign>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0') << Low_byte << dec << "\n";

  fout.close();

  return;

}
int DTConfigManager::getBXOffset ( ) const

Get BX Offset.

Definition at line 230 of file DTConfigManager.cc.

Referenced by DTTrig::getBXOffset().

                                       {

  int ST = static_cast<int>(getDTConfigBti(DTBtiId(1,1,1,1,1))->ST());
  int coarse = getDTConfigSectColl(DTSectCollId(1,1))->CoarseSync(1);
  return (ST/2 + ST%2 + coarse); //CB check this function!

}
DTConfigBti * DTConfigManager::getDTConfigBti ( DTBtiId  btiid) const

Get desired BTI configuration.

Definition at line 63 of file DTConfigManager.cc.

References DTBtiId::bti(), DTSuperLayerId::chamberId(), gather_cfg::cout, DTChamberId::sector(), DTBtiId::sector(), DTBtiId::SLId(), DTChamberId::station(), DTBtiId::station(), DTBtiId::superlayer(), DTBtiId::wheel(), and DTChamberId::wheel().

                                                                {
  
  DTChamberId chambid = btiid.SLId().chamberId();
  BtiMap::const_iterator biter1 = my_btimap.find(chambid);
  if (biter1 == my_btimap.end()){
    std::cout << "DTConfigManager::getConfigBti : Chamber (" << chambid.wheel()
              << "," << chambid.sector()
              << "," << chambid.station() 
              << ") not found, return 0" << std::endl;
    return 0;
  }
  
  innerBtiMap::const_iterator biter2 = (*biter1).second.find(btiid);
  if (biter2 == (*biter1).second.end()){
    std::cout << "DTConfigManager::getConfigBti : BTI (" << btiid.wheel()
              << "," << btiid.sector()
              << "," << btiid.station()
              << "," << btiid.superlayer()
              << "," << btiid.bti()
              << ") not found, return 0" << std::endl;
    return 0;
  }
  return const_cast<DTConfigBti*>(&(*biter2).second);

}  
const std::map< DTBtiId, DTConfigBti > & DTConfigManager::getDTConfigBtiMap ( DTChamberId  chambid) const

Get desired BTI configuration map for a given DTChamber.

Definition at line 89 of file DTConfigManager.cc.

References gather_cfg::cout, DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by DTBtiCard::setConfig().

                                                                                               {
  
  BtiMap::const_iterator biter = my_btimap.find(chambid);
  if (biter == my_btimap.end()){
    std::cout << "DTConfigManager::getConfigBtiMap : Chamber (" << chambid.wheel()
              << "," << chambid.sector()
              << "," << chambid.station() 
              << ") not found, return a reference to the end of the map" << std::endl;
  }
  
  return (*biter).second;

}
DTConfigLUTs * DTConfigManager::getDTConfigLUTs ( DTChamberId  chambid) const

Get desired LUT configuration.

Definition at line 187 of file DTConfigManager.cc.

References gather_cfg::cout, DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by DTTracoCard::setConfig().

                                                                        {
  
   LUTMap::const_iterator lutiter = my_lutmap.find(chambid);
   if (lutiter == my_lutmap.end()){
     std::cout << "DTConfigManager::getConfigLUTs : Chamber (" << chambid.wheel()
              << "," << chambid.sector()
              << "," << chambid.station() 
              << ") not found, return 0" << std::endl;
     return 0;
   }

   return const_cast<DTConfigLUTs*>(&(*lutiter).second);

}
DTConfigSectColl * DTConfigManager::getDTConfigSectColl ( DTSectCollId  scid) const

Get desired SectorCollector configuration.

Definition at line 202 of file DTConfigManager.cc.

References gather_cfg::cout, DTSectCollId::sector(), and DTSectCollId::wheel().

Referenced by DTSectColl::setConfig().

                                                                              {
  
  SectCollMap::const_iterator sciter = my_sectcollmap.find(scid);
  if (sciter == my_sectcollmap.end()){
    std::cout << "DTConfigManager::getConfigSectColl : SectorCollector (" << scid.wheel()
              << "," << scid.sector() 
              << ") not found, return 0" << std::endl;
    return 0;
  }

  return const_cast<DTConfigSectColl*>(&(*sciter).second);

}
DTConfigTraco * DTConfigManager::getDTConfigTraco ( DTTracoId  tracoid) const

Get desired TRACO configuration.

Definition at line 103 of file DTConfigManager.cc.

References DTTracoId::ChamberId(), gather_cfg::cout, DTTracoId::sector(), DTChamberId::sector(), DTTracoId::station(), DTChamberId::station(), DTTracoId::traco(), DTChamberId::wheel(), and DTTracoId::wheel().

                                                                        {
  
  DTChamberId chambid = tracoid.ChamberId();
  TracoMap::const_iterator titer1 = my_tracomap.find(chambid);
  if (titer1 == my_tracomap.end()){
    std::cout << "DTConfigManager::getConfigTraco : Chamber (" << chambid.wheel()
              << "," << chambid.sector()
              << "," << chambid.station() 
              << ") not found, return 0" << std::endl;
    return 0;
  }
  
  innerTracoMap::const_iterator titer2 = (*titer1).second.find(tracoid);
  if (titer2 == (*titer1).second.end()){
    std::cout << "DTConfigManager::getConfigTraco : TRACO (" << tracoid.wheel()
              << "," << tracoid.sector()
              << "," << tracoid.station()
              << "," << tracoid.traco()
              << ") not found, return a reference to the end of the map" << std::endl;
    return 0;
  }
  return const_cast<DTConfigTraco*>(&(*titer2).second);

}
const std::map< DTTracoId, DTConfigTraco > & DTConfigManager::getDTConfigTracoMap ( DTChamberId  chambid) const

Get desired TRACO configuration map for a given DTChamber.

Definition at line 128 of file DTConfigManager.cc.

References gather_cfg::cout, DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by DTTracoCard::setConfig().

                                                                                                     {
  
  TracoMap::const_iterator titer = my_tracomap.find(chambid);
  if (titer == my_tracomap.end()){
    std::cout << "DTConfigManager::getConfigTracoMap : Chamber (" << chambid.wheel()
              << "," << chambid.sector()
              << "," << chambid.station() 
              << ") not found, return 0" << std::endl;
  }

  return (*titer).second;

}
DTConfigTrigUnit * DTConfigManager::getDTConfigTrigUnit ( DTChamberId  chambid) const

Get desired Trigger Unit configuration.

Definition at line 172 of file DTConfigManager.cc.

References gather_cfg::cout, DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by DTBtiCard::setConfig().

                                                                                {
  
   TrigUnitMap::const_iterator tuiter = my_trigunitmap.find(chambid);
   if (tuiter == my_trigunitmap.end()){
     std::cout << "DTConfigManager::getConfigTrigUnit : Chamber (" << chambid.wheel()
              << "," << chambid.sector()
              << "," << chambid.station() 
              << ") not found, return 0" << std::endl;
     return 0;
   }

   return const_cast<DTConfigTrigUnit*>(&(*tuiter).second);

}
DTConfigTSPhi * DTConfigManager::getDTConfigTSPhi ( DTChamberId  chambid) const

Get desired Trigger Server Phi configuration.

Definition at line 157 of file DTConfigManager.cc.

References gather_cfg::cout, DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by DTTSPhi::setConfig().

                                                                          {
  
  TSPhiMap::const_iterator phiter = my_tsphimap.find(chambid);
  if (phiter == my_tsphimap.end()){
    std::cout << "DTConfigManager::getConfigTSPhi : Chamber (" << chambid.wheel()
              << "," << chambid.sector()
              << "," << chambid.station() 
              << ") not found, return 0" << std::endl;
    return 0;
  }

  return const_cast<DTConfigTSPhi*>(&(*phiter).second);

}
DTConfigTSTheta * DTConfigManager::getDTConfigTSTheta ( DTChamberId  chambid) const

Get desired Trigger Server Theta configuration.

Definition at line 142 of file DTConfigManager.cc.

References gather_cfg::cout, DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

                                                                              {
 
  TSThetaMap::const_iterator thiter = my_tsthetamap.find(chambid);
  if (thiter == my_tsthetamap.end()){
    std::cout << "DTConfigManager::getConfigTSTheta : Chamber (" << chambid.wheel()
              << "," << chambid.sector()
              << "," << chambid.station() 
              << ") not found, return 0" << std::endl;
    return 0;
  }
  
  return const_cast<DTConfigTSTheta*>(&(*thiter).second);

}
bool DTConfigManager::getDTTPGDebug ( ) const [inline]

Get global debug flag.

Definition at line 119 of file DTConfigManager.h.

References my_dttpgdebug.

Referenced by DTTracoCard::setConfig(), and DTBtiCard::setConfig().

{ return my_dttpgdebug; };
bool DTConfigManager::lutFromDB ( ) const [inline]

Lut from DB flag.

Definition at line 128 of file DTConfigManager.h.

References m_lutfromdb.

Referenced by DTConfigDBProducer::readDTCCBConfig(), DTTracoCard::setConfig(), and setLutFromDB().

{ return m_lutfromdb; }
void DTConfigManager::setDTConfigBti ( DTBtiId  btiid,
DTConfigBti  conf 
)
void DTConfigManager::setDTConfigLUTs ( DTChamberId  chambid,
DTConfigLUTs  conf 
) [inline]

Set DTConfigLUTs for desired chamber.

Definition at line 113 of file DTConfigManager.h.

References dbtoconf::conf, and my_lutmap.

Referenced by DTConfigTrivialProducer::buildManager(), and DTConfigDBProducer::readDTCCBConfig().

{ my_lutmap[chambid] = conf; };
void DTConfigManager::setDTConfigSectColl ( DTSectCollId  sectcollid,
DTConfigSectColl  conf 
) [inline]
void DTConfigManager::setDTConfigTraco ( DTTracoId  tracoid,
DTConfigTraco  conf 
)

Set DTConfigTraco for desired chip.

Definition at line 223 of file DTConfigManager.cc.

References DTTracoId::ChamberId(), and dbtoconf::conf.

Referenced by DTConfigTrivialProducer::buildManager(), DTConfigDBProducer::configFromCfg(), and DTConfigDBProducer::readDTCCBConfig().

                                                                          {

  DTChamberId chambid = tracoid.ChamberId();
  my_tracomap[chambid][tracoid] = conf;

}  
void DTConfigManager::setDTConfigTrigUnit ( DTChamberId  chambid,
DTConfigTrigUnit  conf 
) [inline]
void DTConfigManager::setDTConfigTSPhi ( DTChamberId  chambid,
DTConfigTSPhi  conf 
) [inline]
void DTConfigManager::setDTConfigTSTheta ( DTChamberId  chambid,
DTConfigTSTheta  conf 
) [inline]
void DTConfigManager::setDTTPGDebug ( bool  debug) [inline]

SetGlobalDebug flag.

Definition at line 122 of file DTConfigManager.h.

References debug, and my_dttpgdebug.

Referenced by DTConfigDBProducer::DTConfigDBProducer(), and DTConfigTrivialProducer::DTConfigTrivialProducer().

void DTConfigManager::setLutFromDB ( bool  lutFromDB) [inline]
void DTConfigManager::setUseAcceptParam ( bool  acceptparam) [inline]

Set the use of Bti acceptance parameters (LL,LH,CL,CH,RL,RH)

Definition at line 137 of file DTConfigManager.h.

References m_acceptparam.

Referenced by DTConfigDBProducer::DTConfigDBProducer(), and DTConfigTrivialProducer::DTConfigTrivialProducer().

{ m_acceptparam = acceptparam; }
bool DTConfigManager::useAcceptParam ( ) const [inline]

Use Bti acceptance parameters (LL,LH,CL,CH,RL,RH)

Definition at line 131 of file DTConfigManager.h.

References m_acceptparam.

Referenced by DTTracoCard::setConfig(), and DTBtiCard::setConfig().

{ return m_acceptparam; }

Member Data Documentation

Definition at line 158 of file DTConfigManager.h.

Referenced by setUseAcceptParam(), and useAcceptParam().

Definition at line 157 of file DTConfigManager.h.

Referenced by lutFromDB(), and setLutFromDB().

Definition at line 146 of file DTConfigManager.h.

Definition at line 154 of file DTConfigManager.h.

Definition at line 155 of file DTConfigManager.h.

Referenced by getDTTPGDebug(), and setDTTPGDebug().

Definition at line 151 of file DTConfigManager.h.

Referenced by setDTConfigLUTs().

Definition at line 152 of file DTConfigManager.h.

Referenced by setDTConfigSectColl().

Definition at line 147 of file DTConfigManager.h.

Definition at line 150 of file DTConfigManager.h.

Referenced by setDTConfigTrigUnit().

Definition at line 149 of file DTConfigManager.h.

Referenced by setDTConfigTSPhi().

Definition at line 148 of file DTConfigManager.h.

Referenced by setDTConfigTSTheta().