CMS 3D CMS Logo

Functions

CastorRecHitPerChan Namespace Reference

Functions

template<class RecHit >
void perChanHists (const RecHit &rhit, std::map< HcalCastorDetId, MonitorElement * > &toolE, std::map< HcalCastorDetId, MonitorElement * > &toolT, DQMStore *dbe, std::string baseFolder)

Function Documentation

template<class RecHit >
void CastorRecHitPerChan::perChanHists ( const RecHit &  rhit,
std::map< HcalCastorDetId, MonitorElement * > &  toolE,
std::map< HcalCastorDetId, MonitorElement * > &  toolT,
DQMStore dbe,
std::string  baseFolder 
) [inline]

Definition at line 124 of file CastorRecHitMonitor.cc.

References DQMStore::book1D(), MonitorElement::Fill(), mergeVDriftHistosByStation::name, and DQMStore::setCurrentFolder().

                                                                {
    
    std::map<HcalCastorDetId,MonitorElement*>::iterator _mei;

    std::string type = "CastorRecHitPerChannel";
    if(dbe) dbe->setCurrentFolder(baseFolder+"/"+type);
    
    _mei=toolE.find(rhit.id()); //-- look for a histogram with this hit's id !!!
    if (_mei!=toolE.end()){
      if (_mei->second==0) return;
      else _mei->second->Fill(rhit.energy()); //-- if it's there, fill it with energy
    }
    else{
       if(dbe){
         char name[1024];
         sprintf(name,"CastorRecHit Energy zside=%d module=%d sector=%d", rhit.id().zside(), rhit.id().module(), rhit.id().sector());
         toolE[rhit.id()] =  dbe->book1D(name,name,60,-10,20); 
         toolE[rhit.id()]->Fill(rhit.energy());
      }
    }
    
    _mei=toolT.find(rhit.id()); //-- look for a histogram with this hit's id
    if (_mei!=toolT.end()){
      if (_mei->second==0) return;
      else _mei->second->Fill(rhit.time()); //-- if it's there, fill it with time
    }
    else{
      if(dbe){
        char name[1024];
        sprintf(name,"CastorRecHit Time zside=%d module=%d sector=%d", rhit.id().zside(), rhit.id().module(), rhit.id().sector());
        toolT[rhit.id()] =  dbe->book1D(name,name,200,-100,100); 
        toolT[rhit.id()]->Fill(rhit.time());
      }
    }
    
    
  }