CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalFedMap Class Reference

#include <EcalFedMap.h>

List of all members.

Public Member Functions

 EcalFedMap ()
int getFedFromSlice (std::string)
std::string getSliceFromFed (int)
 ~EcalFedMap ()

Private Attributes

std::map< int, std::string > fedToSliceMap_
std::map< std::string, int > sliceToFedMap_

Detailed Description

Definition at line 7 of file EcalFedMap.h.


Constructor & Destructor Documentation

EcalFedMap::EcalFedMap ( )

Definition at line 8 of file EcalFedMap.cc.

References fedToSliceMap_, and sliceToFedMap_.

                      {

  // EE-
  fedToSliceMap_.insert( std::make_pair(601, "EE-07") );
  fedToSliceMap_.insert( std::make_pair(602, "EE-08") );
  fedToSliceMap_.insert( std::make_pair(603, "EE-09") );
  fedToSliceMap_.insert( std::make_pair(604, "EE-01") );
  fedToSliceMap_.insert( std::make_pair(605, "EE-02") );
  fedToSliceMap_.insert( std::make_pair(606, "EE-03") );
  fedToSliceMap_.insert( std::make_pair(607, "EE-04") );
  fedToSliceMap_.insert( std::make_pair(608, "EE-05") );
  fedToSliceMap_.insert( std::make_pair(609, "EE-06") );

  // EB-
  fedToSliceMap_.insert( std::make_pair(610, "EB-01") );
  fedToSliceMap_.insert( std::make_pair(611, "EB-02") );
  fedToSliceMap_.insert( std::make_pair(612, "EB-03") );
  fedToSliceMap_.insert( std::make_pair(613, "EB-04") );
  fedToSliceMap_.insert( std::make_pair(614, "EB-05") );
  fedToSliceMap_.insert( std::make_pair(615, "EB-06") );
  fedToSliceMap_.insert( std::make_pair(616, "EB-07") );
  fedToSliceMap_.insert( std::make_pair(617, "EB-08") );
  fedToSliceMap_.insert( std::make_pair(618, "EB-09") );
  fedToSliceMap_.insert( std::make_pair(619, "EB-10") );
  fedToSliceMap_.insert( std::make_pair(620, "EB-11") );
  fedToSliceMap_.insert( std::make_pair(621, "EB-12") );
  fedToSliceMap_.insert( std::make_pair(622, "EB-13") );
  fedToSliceMap_.insert( std::make_pair(623, "EB-14") );
  fedToSliceMap_.insert( std::make_pair(624, "EB-15") );
  fedToSliceMap_.insert( std::make_pair(625, "EB-16") );
  fedToSliceMap_.insert( std::make_pair(626, "EB-17") );
  fedToSliceMap_.insert( std::make_pair(627, "EB-18") );

  // EB+
  fedToSliceMap_.insert( std::make_pair(628, "EB+01") );
  fedToSliceMap_.insert( std::make_pair(629, "EB+02") );
  fedToSliceMap_.insert( std::make_pair(630, "EB+03") );
  fedToSliceMap_.insert( std::make_pair(631, "EB+04") );
  fedToSliceMap_.insert( std::make_pair(632, "EB+05") );
  fedToSliceMap_.insert( std::make_pair(633, "EB+06") );
  fedToSliceMap_.insert( std::make_pair(634, "EB+07") );
  fedToSliceMap_.insert( std::make_pair(635, "EB+08") );
  fedToSliceMap_.insert( std::make_pair(636, "EB+09") );
  fedToSliceMap_.insert( std::make_pair(637, "EB+10") );
  fedToSliceMap_.insert( std::make_pair(638, "EB+11") );
  fedToSliceMap_.insert( std::make_pair(639, "EB+12") );
  fedToSliceMap_.insert( std::make_pair(640, "EB+13") );
  fedToSliceMap_.insert( std::make_pair(641, "EB+14") );
  fedToSliceMap_.insert( std::make_pair(642, "EB+15") );
  fedToSliceMap_.insert( std::make_pair(643, "EB+16") );
  fedToSliceMap_.insert( std::make_pair(644, "EB+17") );
  fedToSliceMap_.insert( std::make_pair(645, "EB+18") );

  // EE+
  fedToSliceMap_.insert( std::make_pair(646, "EE+07") );
  fedToSliceMap_.insert( std::make_pair(647, "EE+08") );
  fedToSliceMap_.insert( std::make_pair(648, "EE+09") );
  fedToSliceMap_.insert( std::make_pair(649, "EE+01") );
  fedToSliceMap_.insert( std::make_pair(650, "EE+02") );
  fedToSliceMap_.insert( std::make_pair(651, "EE+03") );
  fedToSliceMap_.insert( std::make_pair(652, "EE+04") );
  fedToSliceMap_.insert( std::make_pair(653, "EE+05") );
  fedToSliceMap_.insert( std::make_pair(654, "EE+06") );


  std::map<int, std::string>::iterator it;
  for (it = fedToSliceMap_.begin();
       it != fedToSliceMap_.end();
       it++)
    {
      //  std::cout<<  "fed: "<< (*it).first << " slice: " << (*it).second << std::endl;
      sliceToFedMap_.insert( std::make_pair( (*it).second, (*it).first) );
    }

  //  std::map<std::string, int>::iterator ti;
  //  for (ti = sliceToFedMap_.begin();
  //       ti != sliceToFedMap_.end();
  //       ti++)
  //    {
  //      //      std::cout<<  "slice: "<< (*ti).first << " fed: " << (*ti).second << std::endl;
  //    }

}
EcalFedMap::~EcalFedMap ( )

Definition at line 6 of file EcalFedMap.cc.

{}

Member Function Documentation

int EcalFedMap::getFedFromSlice ( std::string  slice)

Definition at line 104 of file EcalFedMap.cc.

References newFWLiteAna::found, sliceToFedMap_, and create_public_pileup_plots::transform.

Referenced by EcalDigiDisplay::EcalDigiDisplay(), EcalPedHists::EcalPedHists(), and EcalPnGraphs::EcalPnGraphs().

{

  transform(slice.begin(), slice.end(), slice.begin(), toupper);

  std::map< std::string , int>::iterator found  = sliceToFedMap_.find(slice);
  
  if ( found != sliceToFedMap_.end() ) 
    return (* found).second;
  else
    return -999;
}
std::string EcalFedMap::getSliceFromFed ( int  fedNumber)

Definition at line 93 of file EcalFedMap.cc.

References fedToSliceMap_, and newFWLiteAna::found.

Referenced by EcalPulseShapeGrapher::analyze(), EcalPedHists::endJob(), EcalCosmicsHists::endJob(), EcalURecHitHists::endJob(), EcalURecHitHists::initHists(), EcalCosmicsHists::initHists(), EcalDisplaysByEvent::initHists(), EcalMipGraphs::initHists(), EcalMipGraphs::selectDigi(), and EcalDisplaysByEvent::selectDigi().

{
  //std::cout << "received: " << fedNumber << std::endl;
  std::map< int, std::string >::iterator found  = fedToSliceMap_.find(fedNumber);
  
  if ( found != fedToSliceMap_.end() ) 
    return (* found).second;
  else
    return std::string("invalid Fed");
}

Member Data Documentation

std::map<int, std::string> EcalFedMap::fedToSliceMap_ [private]

Definition at line 22 of file EcalFedMap.h.

Referenced by EcalFedMap(), and getSliceFromFed().

std::map<std::string, int> EcalFedMap::sliceToFedMap_ [private]

Definition at line 23 of file EcalFedMap.h.

Referenced by EcalFedMap(), and getFedFromSlice().