CMS 3D CMS Logo

SiStripMonitorPedestals Class Reference

Description: <one line="" class="" summary>="">. More...

#include <DQM/SiStripMonitorPedestals/interface/SiStripMonitorPedestals.h>

Inheritance diagram for SiStripMonitorPedestals:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob (edm::EventSetup const &)
virtual void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
virtual void endJob ()
virtual void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 SiStripMonitorPedestals (const edm::ParameterSet &)
 ~SiStripMonitorPedestals ()

Private Member Functions

void createMEs ()
void fillCondDBMEs (edm::EventSetup const &eSetup)
void resetMEs (uint32_t idet)

Private Attributes

bool analyzed
ApvAnalysisFactoryapvFactory_
edm::ParameterSet conf_
edm::ESHandle< SiStripDetCablingdetcabling
DQMStoredqmStore_
bool firstEvent
unsigned long long m_cacheID_
int16_t nEvInit_
int16_t nEvTot_
int16_t nEvUpdate_
int nIteration_
int NumCMstripsInGroup_
std::string outPutFileName
std::map< uint32_t, ModMEsPedMEs
edm::ParameterSet pedsPSet_
std::string runTypeFlag_
int16_t signalCutPeds_
int theEventInitNumber_
int theEventIterNumber_

Static Private Attributes

static const std::string RunMode1 = "ConDBPlotsOnly"
static const std::string RunMode2 = "CalculatedPlotsOnly"
static const std::string RunMode3 = "AllPlots"

Classes

struct  ModMEs


Detailed Description

Description: <one line="" class="" summary>="">.

Usage: <usage>

Definition at line 55 of file SiStripMonitorPedestals.h.


Constructor & Destructor Documentation

SiStripMonitorPedestals::SiStripMonitorPedestals ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 53 of file SiStripMonitorPedestals.cc.

00053                                                                               :
00054   dqmStore_(edm::Service<DQMStore>().operator->()),
00055   conf_(iConfig),
00056   pedsPSet_(iConfig.getParameter<edm::ParameterSet>("PedestalsPSet")),
00057   analyzed(false),
00058   firstEvent(true),
00059   signalCutPeds_(4),
00060   nEvTot_(0),
00061   nIteration_(0),
00062   apvFactory_(0),
00063   m_cacheID_(0)
00064 {
00065   edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals  " 
00066                                           << " Constructing....... ";     
00067 }
//

SiStripMonitorPedestals::~SiStripMonitorPedestals (  ) 

Definition at line 71 of file SiStripMonitorPedestals.cc.

References apvFactory_.

00072 {
00073   edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals  " 
00074                                           << " Destructing...... ";     
00075   if (apvFactory_) {delete apvFactory_;} 
00076 }


Member Function Documentation

void SiStripMonitorPedestals::analyze ( const edm::Event iEvent,
const edm::EventSetup eSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 250 of file SiStripMonitorPedestals.cc.

References apvFactory_, SiStripMonitorPedestals::ModMEs::CMDistribution, SiStripMonitorPedestals::ModMEs::CMSlopeDistribution, SiStripMonitorPedestals::ModMEs::CMSubNoisePerStrip, SiStripMonitorPedestals::ModMEs::CMSubNoiseProfile, conf_, GenMuonPlsPt100GeV_cfg::cout, detcabling, reco_application_tbsim_simpleTBanalysis_cfg::digiProducer, lat::endl(), firstEvent, edm::EventSetup::get(), edm::Event::getByLabel(), ApvAnalysisFactory::getCommonMode(), ApvAnalysisFactory::getCommonModeSlope(), ApvAnalysisFactory::getMask(), ApvAnalysisFactory::getNoise(), edm::ParameterSet::getParameter(), ApvAnalysisFactory::getPedestal(), ApvAnalysisFactory::getRawNoise(), i, edm::Event::id(), int, it, k, nEvTot_, nIteration_, SiStripMonitorPedestals::ModMEs::NoisyStripDistribution, SiStripMonitorPedestals::ModMEs::NoisyStrips, NULL, NumCMstripsInGroup_, PedMEs, SiStripMonitorPedestals::ModMEs::PedsDistribution, SiStripMonitorPedestals::ModMEs::PedsEvolution, SiStripMonitorPedestals::ModMEs::PedsPerStrip, SiStripMonitorPedestals::ModMEs::RawNoisePerStrip, SiStripMonitorPedestals::ModMEs::RawNoiseProfile, RunMode2, RunMode3, runTypeFlag_, pyDBSRunClass::temp, theEventInitNumber_, theEventIterNumber_, tmp, and ApvAnalysisFactory::update().

00251 {
00252 
00253   edm::LogInfo("SiStripMonitorPedestals") <<
00254                "SiStripMonitorPedestals::analyze: Run " << 
00255                iEvent.id().run()  << " Event " << iEvent.id().event();
00256 
00257   eSetup.get<SiStripDetCablingRcd>().get( detcabling );
00258 
00259   if (runTypeFlag_ != RunMode2 &&  runTypeFlag_ != RunMode3 ) return;
00260 
00261   //Increment # of Events
00262   nEvTot_++;
00263  
00264   // retrieve producer name of input StripDigiCollection
00265   std::string digiProducer = conf_.getParameter<std::string>("DigiProducer");
00266   // get DigiCollection object from Event
00267   edm::Handle< edm::DetSetVector<SiStripRawDigi> > digi_collection;
00268   std::string digiType = "VirginRaw";
00269   //you have a collection as there are all the digis for the event for every detector
00270   iEvent.getByLabel(digiProducer, digiType, digi_collection);
00271 
00272   //Increase the number of iterations ...
00273   if((nEvTot_ - theEventInitNumber_)%theEventIterNumber_ == 1) nIteration_++;
00274   
00275 
00276   // loop over all MEs
00277   for (std::map<uint32_t, ModMEs >::const_iterator i = PedMEs.begin() ; i!=PedMEs.end() ; i++) {
00278     uint32_t detid = i->first; ModMEs local_modmes = i->second;
00279     // get iterators for digis belonging to one DetId, it is an iterator, i.e. one element of the vector      
00280     std::vector< edm::DetSet<SiStripRawDigi> >::const_iterator digis = digi_collection->find( detid );
00281     if (digis == digi_collection->end() ||
00282         digis->data.size() == 0 || 
00283         digis->data.size() > 768) {
00284       if (digis == digi_collection->end()) {
00285         edm::LogError("SiStripMonitorPedestals") << " SiStripMonitorPedestals::analyze: Event " <<  nEvTot_ 
00286                << " DetId " <<  detid << " at the end of Digi Collection!!!"; 
00287       } else {
00288         edm::LogError("SiStripMonitorPedestals") << " [SiStripMonitorPedestals::analyze: Event " <<  nEvTot_ 
00289                << " DetId " <<  detid << " # of Digis " << digis->data.size() ;
00290       }
00291       std::vector<FedChannelConnection> fed_conns = detcabling->getConnections(detid);
00292       for (unsigned int  k = 0; k < fed_conns.size() ; k++) {
00293         if (k==0) edm::LogError("SiStripMonitorPedestals") <<" SiStripMonitorPedestals::analyze: Fed Id " <<
00294               fed_conns[k].fedId() << " Channel " << fed_conns[k].fedCh();
00295         else  edm::LogError("SiStripMonitorPedestals")  <<"  SiStripMonitorPedestals::analyze: Channel " <<
00296                             fed_conns[k].fedCh();
00297       }
00298       std::cout << std::endl;
00299       continue;
00300     }
00301 
00302     if ( digis->data.empty() ) { 
00303       edm::LogError("MonitorDigi_tmp") << "[SiStripRawDigiToRaw::createFedBuffers] Zero digis found!"; 
00304     } 
00305     uint32_t id  = detid;
00306     //    cout <<"Data size "<<digis->data.size()<<endl;
00307     apvFactory_->update(id, (*digis));
00308       
00309     if(nEvTot_ > theEventInitNumber_) {
00310       if(local_modmes.CMDistribution != NULL){ 
00311         std::vector<float> tmp;
00312         tmp.clear();
00313         apvFactory_->getCommonMode(id, tmp);
00314         //unpacking the info looking at the right topology
00315         int numberCMBlocks = int(128. / NumCMstripsInGroup_);
00316         int ibin=0;
00317         for (std::vector<float>::const_iterator iped=tmp.begin(); iped!=tmp.end();iped++) {
00318           int iapv = int (ibin/numberCMBlocks);
00319           (local_modmes.CMDistribution)->Fill(iapv,static_cast<float>(*iped));
00320           ibin++;
00321             
00322         }
00323       }
00324       if(local_modmes.CMSlopeDistribution != NULL){ 
00325         std::vector<float> tmp;
00326         tmp.clear();
00327         int iapv = 0;
00328         apvFactory_->getCommonModeSlope(id, tmp);
00329         for (std::vector<float>::const_iterator it=tmp.begin(); it!=tmp.end();it++) {
00330           (local_modmes.CMSlopeDistribution)->Fill(iapv,static_cast<float>(*it));
00331           iapv++;
00332         }
00333       }
00334     }
00335       
00336     //asking for the status
00337     if((nEvTot_ - theEventInitNumber_ - theEventIterNumber_)%theEventIterNumber_ == 1)
00338       {
00339               
00340         std::vector<float> tmp;
00341         tmp.clear();
00342         apvFactory_->getPedestal(id, tmp);
00343         if(local_modmes.PedsPerStrip != NULL){ 
00344           int numberOfApvs = int(tmp.size()/128.);
00345           for(int i=0; i<numberOfApvs;i++){
00346             std::vector<float> myPedPerApv;
00347             apvFactory_->getPedestal(id, i, myPedPerApv);
00348             float avarage = 0;
00349             avarage = accumulate(myPedPerApv.begin(), myPedPerApv.end(), avarage);
00350             avarage = avarage/128.;
00351             (local_modmes.PedsEvolution)->setBinContent(i+1,nIteration_,avarage);
00352               
00353           }
00354           int ibin=0;
00355           
00356           for (std::vector<float>::const_iterator iped=tmp.begin(); iped!=tmp.end();iped++) {
00357             int napv = int(ibin / 128.);
00358             ibin++;
00359             float last_value = (local_modmes.PedsPerStrip)->getBinContent(ibin);
00360             if(last_value != 0.){
00361               (local_modmes.PedsPerStrip)->setBinContent(ibin,(static_cast<float>(*iped) + last_value)/2.);
00362             }else{
00363               (local_modmes.PedsPerStrip)->setBinContent(ibin,static_cast<float>(*iped));
00364             }
00365             (local_modmes.PedsDistribution)->Fill(napv,static_cast<float>(*iped));
00366           }
00367         }
00368           
00369         if(local_modmes.CMSubNoisePerStrip != NULL && local_modmes.CMSubNoiseProfile != NULL){ 
00370           tmp.clear();
00371           apvFactory_->getNoise(id, tmp);
00372           int ibin=0;
00373           for (std::vector<float>::const_iterator iped=tmp.begin(); iped!=tmp.end();iped++) {
00374             ibin++;
00375             (local_modmes.CMSubNoiseProfile)->Fill(static_cast<double>(ibin*1.),static_cast<float>(*iped));
00376 
00377             float last_value = (local_modmes.CMSubNoisePerStrip)->getBinContent(ibin);
00378             if(last_value != 0.){
00379               (local_modmes.CMSubNoisePerStrip)->setBinContent(ibin,(static_cast<float>(*iped)+last_value)/2.);
00380             }else{
00381               (local_modmes.CMSubNoisePerStrip)->setBinContent(ibin,static_cast<float>(*iped));
00382             }
00383           }
00384         }
00385 
00386           
00387         if(local_modmes.RawNoisePerStrip != NULL && local_modmes.RawNoiseProfile != NULL){ 
00388           tmp.clear();
00389           apvFactory_->getRawNoise(id, tmp);
00390           int ibin=0;
00391           for (std::vector<float>::const_iterator iped=tmp.begin(); iped!=tmp.end();iped++) {
00392             ibin++;
00393             (local_modmes.RawNoiseProfile)->Fill(static_cast<double>(ibin*1.),static_cast<float>(*iped));
00394             float last_value = (local_modmes.RawNoisePerStrip)->getBinContent(ibin);
00395             if(last_value != 0.){
00396               (local_modmes.RawNoisePerStrip)->setBinContent(ibin,(static_cast<float>(*iped)+last_value)/2.);
00397             }else{
00398               (local_modmes.RawNoisePerStrip)->setBinContent(ibin,static_cast<float>(*iped));
00399             }
00400           }
00401         }
00402 
00403         if(local_modmes.NoisyStrips != NULL){ 
00404           TkApvMask::MaskType temp;
00405           apvFactory_->getMask(id, temp);
00406           int ibin=0;
00407           for (TkApvMask::MaskType::const_iterator iped=temp.begin(); iped!=temp.end();iped++) {
00408             ibin++;
00409               
00410             if(nIteration_ <2){
00411               if(*iped == 1)
00412                 (local_modmes.NoisyStrips)->Fill(ibin,3.);
00413               if(*iped == 2)
00414                 (local_modmes.NoisyStrips)->Fill(ibin,4.);
00415               if(*iped == 0)
00416                 (local_modmes.NoisyStrips)->Fill(ibin,0.);
00417             }else{
00418               (local_modmes.NoisyStrips)->Fill(ibin,static_cast<float>(*iped));
00419               (local_modmes.NoisyStripDistribution)->Fill(static_cast<float>(*iped));
00420             }
00421           }
00422         }
00423 
00424 
00425       }    
00426   }
00427   if (firstEvent) firstEvent=false;  
00428 }

void SiStripMonitorPedestals::beginJob ( edm::EventSetup const &  eSetup  )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file SiStripMonitorPedestals.cc.

References conf_, edm::ParameterSet::getParameter(), NumCMstripsInGroup_, pedsPSet_, runTypeFlag_, theEventInitNumber_, and theEventIterNumber_.

00080                                                                   {
00081   theEventInitNumber_ = pedsPSet_.getParameter<int>("NumberOfEventsForInit");
00082   theEventIterNumber_ = pedsPSet_.getParameter<int>("NumberOfEventsForIteration");
00083   NumCMstripsInGroup_ = pedsPSet_.getParameter<int>("NumCMstripsInGroup");
00084         runTypeFlag_  = conf_.getParameter<std::string>("RunTypeFlag");
00085 }

void SiStripMonitorPedestals::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file SiStripMonitorPedestals.cc.

References createMEs(), detcabling, fillCondDBMEs(), edm::EventSetup::get(), m_cacheID_, PedMEs, resetMEs(), RunMode1, RunMode3, and runTypeFlag_.

00089                                                                                      {
00090 
00091   unsigned long long cacheID = eSetup.get<SiStripDetCablingRcd>().cacheIdentifier();
00092   if (m_cacheID_ != cacheID) {
00093     m_cacheID_ = cacheID;       
00094     eSetup.get<SiStripDetCablingRcd>().get( detcabling );
00095     edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::beginRun: " 
00096                                           << " Creating MEs for new Cabling ";     
00097     createMEs();
00098   } else {
00099     edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::beginRun: " 
00100                                           << " Resetting MEs ";        
00101     for (std::map<uint32_t, ModMEs >::const_iterator idet = PedMEs.begin() ; idet!=PedMEs.end() ; idet++) {
00102       resetMEs(idet->first);
00103     }
00104   }
00105   if (runTypeFlag_ == RunMode1 || runTypeFlag_ == RunMode3 ) fillCondDBMEs(eSetup);
00106 }

void SiStripMonitorPedestals::createMEs (  )  [private]

Definition at line 110 of file SiStripMonitorPedestals.cc.

References apvFactory_, SiStripMonitorPedestals::ModMEs::BadStripsDB, DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookProfile(), SiStripMonitorPedestals::ModMEs::CMDistribution, SiStripMonitorPedestals::ModMEs::CMSlopeDistribution, SiStripMonitorPedestals::ModMEs::CMSubNoisePerStrip, SiStripMonitorPedestals::ModMEs::CMSubNoisePerStripDB, SiStripMonitorPedestals::ModMEs::CMSubNoiseProfile, SiStripHistoId::createHistoId(), detcabling, dqmStore_, ApvAnalysisFactory::instantiateApvs(), SiStripMonitorPedestals::ModMEs::NoisyStripDistribution, SiStripMonitorPedestals::ModMEs::NoisyStrips, PedMEs, SiStripMonitorPedestals::ModMEs::PedsDistribution, SiStripMonitorPedestals::ModMEs::PedsEvolution, SiStripMonitorPedestals::ModMEs::PedsPerStrip, SiStripMonitorPedestals::ModMEs::PedsPerStripDB, pedsPSet_, SiStripMonitorPedestals::ModMEs::RawNoisePerStrip, SiStripMonitorPedestals::ModMEs::RawNoiseProfile, resetMEs(), RunMode1, RunMode2, RunMode3, runTypeFlag_, SiStripFolderOrganizer::setDetectorFolder(), and DQMStore::tag().

Referenced by beginRun().

00110                                         {
00111   std::vector<uint32_t> SelectedDetIds;
00112   
00113   //ApvAnalysisFactory
00114   if (apvFactory_) {delete apvFactory_;} 
00115   apvFactory_ = new ApvAnalysisFactory(pedsPSet_);
00116   
00117   detcabling->addActiveDetectorsRawIds(SelectedDetIds);
00118   
00119   // use SistripHistoId for producing histogram id (and title)
00120   SiStripHistoId hidmanager;
00121   // create SiStripFolderOrganizer
00122   SiStripFolderOrganizer folder_organizer;
00123   
00124   edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::createMEs: " 
00125           << "Number of Detector Present in cabling " << SelectedDetIds.size();
00126 
00127   for (std::vector<uint32_t>::const_iterator idetid=SelectedDetIds.begin(), iEnd=SelectedDetIds.end();idetid!=iEnd;++idetid){
00128     
00129     uint32_t detid = *idetid;
00130 
00131     // Check consistency in DetId
00132     if (detid == 0 || detid == 0xFFFFFFFF){
00133       edm::LogError("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::createMEs: " 
00134         << "Wrong DetId !!!!!! " <<  detid << " Neglecting !!!!!! ";
00135       continue;
00136     }
00137 
00138     unsigned int apv_pairs = detcabling->nApvPairs(detid);
00139     
00140     // Check consistency in Apv numbers
00141     if (apv_pairs < 1 || apv_pairs > 3) {
00142       edm::LogError("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::createMEs: Wrong APV Pairs  => detId "
00143                 << detid  << " APV pairs " << apv_pairs <<  " Neglecting !!!!!! ";
00144       continue;
00145     }
00146     unsigned int napvs = apv_pairs * 2;
00147     unsigned int nStrip  = napvs * 128;
00148 
00149     bool newDetId =   apvFactory_->instantiateApvs(detid,napvs);  
00150   
00151     if( newDetId ) {
00152       ModMEs local_modmes;
00153       std::string hid;
00154       // set appropriate folder using SiStripFolderOrganizer
00155       folder_organizer.setDetectorFolder(detid); // pass the detid to this method
00156       
00157       // if the deid already exists in the map, then reset MEs otherwise create them
00158       resetMEs(detid);
00159       
00160       if (runTypeFlag_ == RunMode1 || runTypeFlag_ == RunMode3 ) {
00161         //Pedestals histos
00162         hid = hidmanager.createHistoId("PedestalFromCondDB","det", detid);
00163         local_modmes.PedsPerStripDB = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5); //to modify the size binning 
00164         dqmStore_->tag(local_modmes.PedsPerStripDB, detid);
00165         (local_modmes.PedsPerStripDB)->setAxisTitle("Pedestal from CondDB(ADC) vs Strip Number",1);
00166         
00167         hid = hidmanager.createHistoId("NoiseFromCondDB","det", detid);
00168         local_modmes.CMSubNoisePerStripDB = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5);
00169         dqmStore_->tag(local_modmes.CMSubNoisePerStripDB, detid);
00170         (local_modmes.CMSubNoisePerStripDB)->setAxisTitle("CMSubNoise from CondDB(ADC) vs Strip Number",1);
00171         
00172         hid = hidmanager.createHistoId("BadStripFlagCondDB","det", detid);
00173         local_modmes.BadStripsDB = dqmStore_->book2D(hid, hid, nStrip,0.5,nStrip+0.5,6,-0.5,5.5);
00174         dqmStore_->tag(local_modmes.BadStripsDB, detid);
00175         (local_modmes.BadStripsDB)->setAxisTitle("Strip Flag from CondDB(ADC) vs Strip Number",1);
00176       }
00177       if (runTypeFlag_ == RunMode2 || runTypeFlag_ == RunMode3 ) { 
00178         //Pedestals histos
00179         hid = hidmanager.createHistoId("PedsPerStrip","det", detid);
00180         local_modmes.PedsPerStrip = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5); //to modify the size binning 
00181         dqmStore_->tag(local_modmes.PedsPerStrip, detid);
00182         (local_modmes.PedsPerStrip)->setAxisTitle("Pedestal (ADC)  vs Strip Number ",1);
00183         
00184         hid = hidmanager.createHistoId("PedsDistribution","det", detid);
00185         local_modmes.PedsDistribution = dqmStore_->book2D(hid, hid, napvs,-0.5,napvs-0.5, 300, 200, 500); //to modify the size binning 
00186         dqmStore_->tag(local_modmes.PedsDistribution, detid);
00187         (local_modmes.PedsDistribution)->setAxisTitle("Apv Number",1);
00188         (local_modmes.PedsDistribution)->setAxisTitle("Mean Pedestal Value (ADC)",2);
00189         
00190         hid = hidmanager.createHistoId("PedsEvolution","det", detid);
00191         local_modmes.PedsEvolution = dqmStore_->book2D(hid, hid, napvs,-0.5,napvs-0.5, 50, 0., 50.); //to modify the size binning 
00192         dqmStore_->tag(local_modmes.PedsEvolution, detid);
00193         (local_modmes.PedsEvolution)->setAxisTitle("Apv Number",1);
00194         (local_modmes.PedsEvolution)->setAxisTitle("Iteration Number",2);
00195         
00196         //Noise histos
00197         hid = hidmanager.createHistoId("CMSubNoisePerStrip","det", detid);
00198         local_modmes.CMSubNoisePerStrip = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5);
00199         dqmStore_->tag(local_modmes.CMSubNoisePerStrip, detid);
00200         (local_modmes.CMSubNoisePerStrip)->setAxisTitle("CMSubNoise (ADC) vs Strip Number",1);
00201         
00202         hid = hidmanager.createHistoId("RawNoisePerStrip","det", detid);
00203         local_modmes.RawNoisePerStrip = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5);
00204         dqmStore_->tag(local_modmes.RawNoisePerStrip, detid);
00205         (local_modmes.RawNoisePerStrip)->setAxisTitle("RawNoise(ADC) vs Strip Number",1);
00206         
00207         hid = hidmanager.createHistoId("CMSubNoiseProfile","det", detid);
00208         local_modmes.CMSubNoiseProfile = dqmStore_->bookProfile(hid, hid, nStrip,0.5,nStrip+0.5, 100, 0., 100.);
00209         dqmStore_->tag(local_modmes.CMSubNoiseProfile, detid);
00210         (local_modmes.CMSubNoiseProfile)->setAxisTitle("Mean of CMSubNoise (ADC) vs Strip Number",1);
00211         
00212         hid = hidmanager.createHistoId("RawNoiseProfile","det", detid);
00213         local_modmes.RawNoiseProfile = dqmStore_->bookProfile(hid, hid, nStrip,0.5,nStrip+0.5, 100, 0., 100.);
00214         dqmStore_->tag(local_modmes.RawNoiseProfile, detid);
00215         (local_modmes.RawNoiseProfile)->setAxisTitle("Mean of RawNoise (ADC) vs Strip Number",1);
00216         
00217         hid = hidmanager.createHistoId("NoisyStrips","det", detid);
00218         local_modmes.NoisyStrips = dqmStore_->book2D(hid, hid, nStrip,0.5,nStrip+0.5,6,-0.5,5.5);
00219         dqmStore_->tag(local_modmes.NoisyStrips, detid);
00220         (local_modmes.NoisyStrips)->setAxisTitle("Strip Number",1);
00221         (local_modmes.NoisyStrips)->setAxisTitle("Flag Value",2);
00222         
00223         hid = hidmanager.createHistoId("NoisyStripDistribution","det", detid);
00224         local_modmes.NoisyStripDistribution = dqmStore_->book1D(hid, hid, 11, -0.5,10.5);
00225         dqmStore_->tag(local_modmes.NoisyStripDistribution, detid);
00226         (local_modmes.NoisyStripDistribution)->setAxisTitle("Flag Value",1);
00227         
00228         //Common Mode histos
00229         hid = hidmanager.createHistoId("CMDistribution","det", detid);
00230         local_modmes.CMDistribution = dqmStore_->book2D(hid, hid, napvs,-0.5,napvs-0.5, 150, -15., 15.); 
00231         dqmStore_->tag(local_modmes.CMDistribution, detid);
00232         (local_modmes.CMDistribution)->setAxisTitle("Common Mode (ADC) vs APV Number",1);
00233       
00234         hid = hidmanager.createHistoId("CMSlopeDistribution","det", detid);
00235         local_modmes.CMSlopeDistribution = dqmStore_->book2D(hid, hid, napvs,-0.5,napvs-0.5, 100, -0.05, 0.05); 
00236         dqmStore_->tag(local_modmes.CMSlopeDistribution, detid);
00237         (local_modmes.CMSlopeDistribution)->setAxisTitle("Common Mode Slope vs APV Number",1);
00238         
00239       }
00240       // data from CondDB
00241       // append to PedMEs
00242       PedMEs.insert( std::make_pair(detid, local_modmes));
00243     } //newDetId
00244           
00245   }
00246   edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::createMEs: Number of DETS used "
00247                    <<PedMEs.size();
00248 }

void SiStripMonitorPedestals::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 443 of file SiStripMonitorPedestals.cc.

00443                                         {
00444   edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::EndJob: " 
00445                                           << " Finishing!! ";        
00446 }

void SiStripMonitorPedestals::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 432 of file SiStripMonitorPedestals.cc.

References conf_, dqmStore_, edm::ParameterSet::getParameter(), outPutFileName, and DQMStore::save().

00432                                                                                    {
00433   bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
00434   if (outputMEsInRootFile) {    
00435     std::string outPutFileName = conf_.getParameter<std::string>("OutPutFileName");
00436 //    dqmStore_->showDirStructure();
00437     dqmStore_->save(outPutFileName);
00438   }
00439 }

void SiStripMonitorPedestals::fillCondDBMEs ( edm::EventSetup const &  eSetup  )  [private]

Definition at line 477 of file SiStripMonitorPedestals.cc.

References SiStripMonitorPedestals::ModMEs::BadStripsDB, SiStripMonitorPedestals::ModMEs::CMSubNoisePerStripDB, conf_, detcabling, e, edm::EventSetup::get(), edm::ParameterSet::getParameter(), i, PedMEs, SiStripMonitorPedestals::ModMEs::PedsPerStripDB, and cms::Exception::what().

Referenced by beginRun().

00477                                                                        {
00478   //get Pedestal and Noise  ES handle
00479   edm::ESHandle<SiStripPedestals> pedestalHandle;
00480   edm::ESHandle<SiStripNoises> noiseHandle;
00481   edm::ESHandle<SiStripQuality> qualityHandle;
00482   
00483   eSetup.get<SiStripPedestalsRcd>().get(pedestalHandle);
00484   eSetup.get<SiStripNoisesRcd>().get(noiseHandle);
00485   std::string quality_label = conf_.getParameter<std::string>("StripQualityLabel");
00486   eSetup.get<SiStripQualityRcd>().get(quality_label, qualityHandle);
00487 
00488   for (std::map<uint32_t, ModMEs >::const_iterator i = PedMEs.begin() ; i!=PedMEs.end() ; i++) {
00489     uint32_t detid = i->first; 
00490     ModMEs local_modmes = i->second;
00491     edm::LogInfo("SiStripMonitorPedestals") <<" SiStripMonitorPedestals::analyze: " <<
00492       " Get Ped/Noise/Bad Strips from CondDb for DetId " << detid;
00493     int nStrip  = detcabling->nApvPairs(detid) * 256;
00494     // Get range of pedestal and noise for the detid
00495     SiStripNoises::Range noiseRange = noiseHandle->getRange(detid);
00496     SiStripPedestals::Range pedRange = pedestalHandle->getRange(detid);
00497     SiStripQuality::Range qualityRange = qualityHandle->getRange(detid);
00498     
00499     for(int istrip=0;istrip<nStrip;++istrip){
00500       try{
00501         //Fill Pedestals
00502         (local_modmes.PedsPerStripDB)->Fill(istrip+1,pedestalHandle->getPed(istrip,pedRange));
00503       }
00504       catch(cms::Exception& e){
00505         edm::LogError("SiStripMonitorPedestals") << "[SiStripMonitorPedestals::analyze]  cms::Exception accessing SiStripPedestalsService_.getPedestal("<<detid<<","<<istrip<<") :  "  << " " << e.what() ;
00506       }
00507       try{
00508         //Fill Noises
00509         (local_modmes.CMSubNoisePerStripDB)->Fill(istrip+1,noiseHandle->getNoise(istrip,noiseRange));
00510         
00511       }
00512       catch(cms::Exception& e){
00513         edm::LogError("SiStripMonitorPedestals") << "[SiStripMonitorPedestals::analyze]  cms::Exception accessing SiStripNoiseService_.getNoise("<<detid<<","<<istrip<<") :  "  << " " << e.what() ;
00514       }
00515       try{
00516         //Fill BadStripsNoise
00517         (local_modmes.BadStripsDB)->Fill(istrip+1,qualityHandle->IsStripBad(qualityRange,istrip)?1.:0.);
00518         
00519         
00520       }
00521       catch(cms::Exception& e){
00522         edm::LogError("SiStripMonitorPedestals") << "[SiStripMonitorPedestals::analyze]  cms::Exception accessing SiStripNoiseService_.getDisable("<<detid<<","<<istrip<<") :  "  << " " << e.what() ;
00523       }
00524     }//close istrip loop
00525   }
00526 }

void SiStripMonitorPedestals::resetMEs ( uint32_t  idet  )  [private]

Definition at line 450 of file SiStripMonitorPedestals.cc.

References SiStripMonitorPedestals::ModMEs::BadStripsDB, SiStripMonitorPedestals::ModMEs::CMDistribution, SiStripMonitorPedestals::ModMEs::CMSlopeDistribution, SiStripMonitorPedestals::ModMEs::CMSubNoisePerStrip, SiStripMonitorPedestals::ModMEs::CMSubNoisePerStripDB, SiStripMonitorPedestals::ModMEs::CMSubNoiseProfile, SiStripMonitorPedestals::ModMEs::NoisyStrips, PedMEs, SiStripMonitorPedestals::ModMEs::PedsDistribution, SiStripMonitorPedestals::ModMEs::PedsEvolution, SiStripMonitorPedestals::ModMEs::PedsPerStrip, SiStripMonitorPedestals::ModMEs::PedsPerStripDB, SiStripMonitorPedestals::ModMEs::RawNoisePerStrip, SiStripMonitorPedestals::ModMEs::RawNoiseProfile, MonitorElement::Reset(), RunMode1, RunMode2, RunMode3, and runTypeFlag_.

Referenced by beginRun(), and createMEs().

00450                                                    {
00451   std::map<uint32_t, ModMEs >::iterator pos = PedMEs.find(idet);
00452   if (pos != PedMEs.end()) {
00453     ModMEs mod_me = pos->second;
00454 
00455     if (runTypeFlag_ == RunMode1 || runTypeFlag_ == RunMode3 ) { 
00456       mod_me.PedsPerStripDB->Reset();     
00457       mod_me.CMSubNoisePerStripDB->Reset();     
00458       mod_me.BadStripsDB->Reset();     
00459     }
00460     if (runTypeFlag_ == RunMode2 || runTypeFlag_ == RunMode3 ) { 
00461       mod_me.PedsPerStrip->Reset();      
00462       mod_me.PedsDistribution->Reset();      
00463       mod_me.PedsEvolution->Reset();      
00464       mod_me.CMSubNoisePerStrip->Reset();      
00465       mod_me.RawNoisePerStrip->Reset();      
00466       mod_me.CMSubNoiseProfile->Reset();      
00467       mod_me.RawNoiseProfile->Reset();      
00468       mod_me.NoisyStrips->Reset();      
00469       mod_me.CMDistribution->Reset();     
00470       mod_me.CMSlopeDistribution->Reset(); 
00471     }
00472   }
00473 }


Member Data Documentation

bool SiStripMonitorPedestals::analyzed [private]

Definition at line 100 of file SiStripMonitorPedestals.h.

ApvAnalysisFactory* SiStripMonitorPedestals::apvFactory_ [private]

Definition at line 109 of file SiStripMonitorPedestals.h.

Referenced by analyze(), createMEs(), and ~SiStripMonitorPedestals().

edm::ParameterSet SiStripMonitorPedestals::conf_ [private]

Definition at line 96 of file SiStripMonitorPedestals.h.

Referenced by analyze(), beginJob(), endRun(), and fillCondDBMEs().

edm::ESHandle<SiStripDetCabling> SiStripMonitorPedestals::detcabling [private]

Definition at line 98 of file SiStripMonitorPedestals.h.

Referenced by analyze(), beginRun(), createMEs(), and fillCondDBMEs().

DQMStore* SiStripMonitorPedestals::dqmStore_ [private]

Definition at line 95 of file SiStripMonitorPedestals.h.

Referenced by createMEs(), and endRun().

bool SiStripMonitorPedestals::firstEvent [private]

Definition at line 101 of file SiStripMonitorPedestals.h.

Referenced by analyze().

unsigned long long SiStripMonitorPedestals::m_cacheID_ [private]

Definition at line 115 of file SiStripMonitorPedestals.h.

Referenced by beginRun().

int16_t SiStripMonitorPedestals::nEvInit_ [private]

Definition at line 107 of file SiStripMonitorPedestals.h.

int16_t SiStripMonitorPedestals::nEvTot_ [private]

Definition at line 106 of file SiStripMonitorPedestals.h.

Referenced by analyze().

int16_t SiStripMonitorPedestals::nEvUpdate_ [private]

Definition at line 104 of file SiStripMonitorPedestals.h.

int SiStripMonitorPedestals::nIteration_ [private]

Definition at line 108 of file SiStripMonitorPedestals.h.

Referenced by analyze().

int SiStripMonitorPedestals::NumCMstripsInGroup_ [private]

Definition at line 112 of file SiStripMonitorPedestals.h.

Referenced by analyze(), and beginJob().

std::string SiStripMonitorPedestals::outPutFileName [private]

Definition at line 114 of file SiStripMonitorPedestals.h.

Referenced by endRun().

std::map<uint32_t, ModMEs> SiStripMonitorPedestals::PedMEs [private]

Definition at line 97 of file SiStripMonitorPedestals.h.

Referenced by analyze(), beginRun(), createMEs(), fillCondDBMEs(), and resetMEs().

edm::ParameterSet SiStripMonitorPedestals::pedsPSet_ [private]

Definition at line 99 of file SiStripMonitorPedestals.h.

Referenced by beginJob(), and createMEs().

const std::string SiStripMonitorPedestals::RunMode1 = "ConDBPlotsOnly" [static, private]

Definition at line 117 of file SiStripMonitorPedestals.h.

Referenced by beginRun(), createMEs(), and resetMEs().

const std::string SiStripMonitorPedestals::RunMode2 = "CalculatedPlotsOnly" [static, private]

Definition at line 118 of file SiStripMonitorPedestals.h.

Referenced by analyze(), createMEs(), and resetMEs().

const std::string SiStripMonitorPedestals::RunMode3 = "AllPlots" [static, private]

Definition at line 119 of file SiStripMonitorPedestals.h.

Referenced by analyze(), beginRun(), createMEs(), and resetMEs().

std::string SiStripMonitorPedestals::runTypeFlag_ [private]

Definition at line 113 of file SiStripMonitorPedestals.h.

Referenced by analyze(), beginJob(), beginRun(), createMEs(), and resetMEs().

int16_t SiStripMonitorPedestals::signalCutPeds_ [private]

Definition at line 105 of file SiStripMonitorPedestals.h.

int SiStripMonitorPedestals::theEventInitNumber_ [private]

Definition at line 110 of file SiStripMonitorPedestals.h.

Referenced by analyze(), and beginJob().

int SiStripMonitorPedestals::theEventIterNumber_ [private]

Definition at line 111 of file SiStripMonitorPedestals.h.

Referenced by analyze(), and beginJob().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:25 2009 for CMSSW by  doxygen 1.5.4