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

bool CCBConfigValidity () const
 flag for CCB configuration validity
 DTConfigManager ()
 Constructor.
void dumpLUTParam (DTChamberId &chambid) const
 Dump luts string commands from configuration parameters.
int getBXOffset () const
 Get BX Offset for a given vdrift config.
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.
DTConfigPedestalsgetDTConfigPedestals () const
 Get desired Pedestals 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 setCCBConfigValidity (bool CCBValid)
 Set the flag for CCB configuration validity.
void setDTConfigBti (DTBtiId, DTConfigBti)
 Set DTConfigBti for desired chip.
void setDTConfigLUTs (DTChamberId chambid, DTConfigLUTs conf)
 Set DTConfigLUTs for desired chamber.
void setDTConfigPedestals (DTConfigPedestals pedestals)
 Set DTConfigPedestals configuration.
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 my_acceptparam
BtiMap my_btimap
bool my_CCBvalid
bool my_dttpgdebug
bool my_lutfromdb
LUTMap my_lutmap
DTConfigPedestals my_pedestals
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 50 of file DTConfigManager.h.


Member Typedef Documentation

Definition at line 56 of file DTConfigManager.h.

Definition at line 54 of file DTConfigManager.h.

Definition at line 55 of file DTConfigManager.h.

Definition at line 61 of file DTConfigManager.h.

Definition at line 62 of file DTConfigManager.h.

Definition at line 57 of file DTConfigManager.h.

Definition at line 60 of file DTConfigManager.h.

Definition at line 59 of file DTConfigManager.h.

Definition at line 58 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

bool DTConfigManager::CCBConfigValidity ( ) const [inline]

flag for CCB configuration validity

Definition at line 115 of file DTConfigManager.h.

References my_CCBvalid.

{ return my_CCBvalid; }
void DTConfigManager::dumpLUTParam ( DTChamberId chambid) const

Dump luts string commands from configuration parameters.

Definition at line 243 of file DTConfigManager.cc.

References DTConfigLUTs::D(), groupFilesInBlocks::fout, DTConfigLUTs::IEEE32toDSP(), mergeVDriftHistosByStation::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 for a given vdrift config.

Definition at line 222 of file DTConfigManager.cc.

Referenced by DTTrig::getBXOffset().

                                       {

  int ST = static_cast<int>(getDTConfigBti(DTBtiId(1,1,1,1,1))->ST());
  return (ST/2 + ST%2);

}
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 DTConfigDBProducer::checkDTCCBConfig(), and 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);

}
DTConfigPedestals * DTConfigManager::getDTConfigPedestals ( ) const

Get desired Pedestals configuration.

Definition at line 216 of file DTConfigManager.cc.

Referenced by DTBtiCard::setConfig().

                                                              {
  
  return  const_cast<DTConfigPedestals*>(&my_pedestals);

}
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 DTConfigDBProducer::checkDTCCBConfig(), and 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().

                                                                                {
  
   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 DTConfigDBProducer::checkDTCCBConfig(), and 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 103 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 109 of file DTConfigManager.h.

References my_lutfromdb.

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

{ return my_lutfromdb; }
void DTConfigManager::setCCBConfigValidity ( bool  CCBValid) [inline]

Set the flag for CCB configuration validity.

Definition at line 152 of file DTConfigManager.h.

References my_CCBvalid.

Referenced by DTConfigDBProducer::configFromCfg(), DTConfigDBProducer::produce(), and DTConfigDBProducer::readDTCCBConfig().

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

Set DTConfigLUTs for desired chamber.

Definition at line 134 of file DTConfigManager.h.

References dbtoconf::conf, and my_lutmap.

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

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

Set DTConfigTraco for desired chip.

Definition at line 236 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 143 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 149 of file DTConfigManager.h.

References my_acceptparam.

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

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

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

Definition at line 112 of file DTConfigManager.h.

References my_acceptparam.

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

{ return my_acceptparam; }

Member Data Documentation

Definition at line 173 of file DTConfigManager.h.

Referenced by setUseAcceptParam(), and useAcceptParam().

Definition at line 161 of file DTConfigManager.h.

Definition at line 174 of file DTConfigManager.h.

Referenced by CCBConfigValidity(), and setCCBConfigValidity().

Definition at line 170 of file DTConfigManager.h.

Referenced by getDTTPGDebug(), and setDTTPGDebug().

Definition at line 172 of file DTConfigManager.h.

Referenced by lutFromDB(), and setLutFromDB().

Definition at line 166 of file DTConfigManager.h.

Referenced by setDTConfigLUTs().

Definition at line 168 of file DTConfigManager.h.

Referenced by setDTConfigPedestals().

Definition at line 167 of file DTConfigManager.h.

Referenced by setDTConfigSectColl().

Definition at line 162 of file DTConfigManager.h.

Definition at line 165 of file DTConfigManager.h.

Referenced by setDTConfigTrigUnit().

Definition at line 164 of file DTConfigManager.h.

Referenced by setDTConfigTSPhi().

Definition at line 163 of file DTConfigManager.h.

Referenced by setDTConfigTSTheta().