From 8edee59d5a9909786a6f6560e9363ec2f3f4679f Mon Sep 17 00:00:00 2001 From: "W.David Dagenhart" Date: Tue, 9 Oct 2012 14:58:05 +0000 Subject: [PATCH] --- yaml --- r: 120991 b: "refs/heads/CMSSW_7_0_X" c: 54ef9ca1840db83480c4e6f05278b941a23398e3 h: "refs/heads/CMSSW_7_0_X" i: 120989: 9ef2b5a5934b252e42015797de6125452d3fa4d6 120987: c0f784ed6c11b560a87de89fb05af31f8f869d07 120983: ebed7291e1f7ceeae832806e006ba38ca9b5f1f4 120975: e57c572b0c0a1c7715b0b2dfbf1f466444f72a61 120959: 7aa1ab98fdadeb906cf8118e193ddc059420792e v: v3 --- [refs] | 2 +- .../HcalStandardModules/BuildFile.xml | 5 +- .../interface/HFLightCal.h | 3 + .../interface/HFLightCalRand.h | 3 + .../interface/HFPreLightCal.h | 3 + .../interface/HcalLedAnalyzer.h | 6 + .../interface/HcalPedestalAnalyzer.h | 9 +- .../interface/HcalPedestalMCWidths.h | 5 + .../interface/HcalPedestalWidthsValidation.h | 5 + .../interface/HcalPedestalsAnalysis.h | 9 +- .../HcalStandardModules/src/HFLightCal.cc | 9 +- .../HcalStandardModules/src/HFLightCalRand.cc | 9 +- .../HcalStandardModules/src/HFPreLightCal.cc | 9 +- .../src/HcalLedAnalyzer.cc | 15 +- .../src/HcalPedestalAnalyzer.cc | 15 +- .../src/HcalPedestalMCWidths.cc | 13 +- .../src/HcalPedestalWidthsValidation.cc | 14 +- .../src/HcalPedestalsAnalysis.cc | 129 ++++++++---------- 18 files changed, 150 insertions(+), 113 deletions(-) diff --git a/[refs] b/[refs] index 6233c72eccdcf..ad767b04fbbe7 100644 --- a/[refs] +++ b/[refs] @@ -2,4 +2,4 @@ "refs/heads/hi_d20131223": d7335b053d7fe03e98f9f59af6a20004362628e8 refs/heads/gh-pages: a3d9046c56a3ca3dc64ad63f7295276c81ac876a "refs/heads/analysis_53X_01": 3019419e9784b2b092fc6b5c503b2e0177cbe926 -"refs/heads/CMSSW_7_0_X": 86b79325ae845ac0edc95cd571b347eb35547030 +"refs/heads/CMSSW_7_0_X": 54ef9ca1840db83480c4e6f05278b941a23398e3 diff --git a/trunk/CalibCalorimetry/HcalStandardModules/BuildFile.xml b/trunk/CalibCalorimetry/HcalStandardModules/BuildFile.xml index e01b4584e6181..df595b56be4da 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/BuildFile.xml +++ b/trunk/CalibCalorimetry/HcalStandardModules/BuildFile.xml @@ -1,11 +1,8 @@ - - + - - diff --git a/trunk/CalibCalorimetry/HcalStandardModules/interface/HFLightCal.h b/trunk/CalibCalorimetry/HcalStandardModules/interface/HFLightCal.h index 7837e9be712ba..6bbe46e581b62 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/interface/HFLightCal.h +++ b/trunk/CalibCalorimetry/HcalStandardModules/interface/HFLightCal.h @@ -3,6 +3,7 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Utilities/interface/InputTag.h" class TFile; class TH1F; @@ -42,6 +43,8 @@ class HFLightCal : public edm::EDAnalyzer { TH1F* hpedpin[8][3]; TH1F* htsmpin[8][3]; + edm::InputTag hfDigiCollectionTag_; + edm::InputTag hcalCalibDigiCollectionTag_; }; #endif diff --git a/trunk/CalibCalorimetry/HcalStandardModules/interface/HFLightCalRand.h b/trunk/CalibCalorimetry/HcalStandardModules/interface/HFLightCalRand.h index 188c184c9bcf3..bdcb2c6f451bd 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/interface/HFLightCalRand.h +++ b/trunk/CalibCalorimetry/HcalStandardModules/interface/HFLightCalRand.h @@ -3,6 +3,7 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Utilities/interface/InputTag.h" class TFile; class TH1F; @@ -42,6 +43,8 @@ class HFLightCalRand : public edm::EDAnalyzer { TH1F* hpedpin[8][3]; TH1F* htsmpin[8][3]; + edm::InputTag hfDigiCollectionTag_; + edm::InputTag hcalCalibDigiCollectionTag_; }; #endif diff --git a/trunk/CalibCalorimetry/HcalStandardModules/interface/HFPreLightCal.h b/trunk/CalibCalorimetry/HcalStandardModules/interface/HFPreLightCal.h index bb321c107afe9..429e8a11f27fc 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/interface/HFPreLightCal.h +++ b/trunk/CalibCalorimetry/HcalStandardModules/interface/HFPreLightCal.h @@ -3,6 +3,7 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Utilities/interface/InputTag.h" class TFile; class TH1F; @@ -31,6 +32,8 @@ class HFPreLightCal : public edm::EDAnalyzer { TH1F *htsmax,*htspinmax; TH1F* htspin[8][3]; + edm::InputTag hfDigiCollectionTag_; + edm::InputTag hcalCalibDigiCollectionTag_; }; #endif diff --git a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalLedAnalyzer.h b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalLedAnalyzer.h index e69435fe385e5..1fa2dccd82eb1 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalLedAnalyzer.h +++ b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalLedAnalyzer.h @@ -8,6 +8,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalLedAnalysis.h" @@ -53,6 +54,11 @@ void endJob(void); std::string m_inputPedestals_source; std::string m_inputPedestals_tag; int m_inputPedestals_run; + + edm::InputTag hbheDigiCollectionTag_; + edm::InputTag hoDigiCollectionTag_; + edm::InputTag hfDigiCollectionTag_; + edm::InputTag hcalCalibDigiCollectionTag_; }; #endif diff --git a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalAnalyzer.h b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalAnalyzer.h index e1482cfeb4374..43bf8657881c4 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalAnalyzer.h +++ b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalAnalyzer.h @@ -4,8 +4,8 @@ /* * \file HcalPedestalAnalyzer.h * - * $Date: 2006/03/24 01:00:15 $ - * $Revision: 1.2 $ + * $Date: 2009/12/17 21:09:32 $ + * $Revision: 1.3 $ * \author S. Stoynev / W. Fisher * */ @@ -17,6 +17,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalPedestalAnalysis.h" @@ -85,6 +86,10 @@ void endJob(void); std::string m_outputPedestalWidths_dest; std::string m_outputPedestalWidths_tag; int m_outputPedestalWidths_run; + + edm::InputTag hbheDigiCollectionTag_; + edm::InputTag hoDigiCollectionTag_; + edm::InputTag hfDigiCollectionTag_; }; #endif diff --git a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalMCWidths.h b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalMCWidths.h index 20ea0e6eac460..edaf482353315 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalMCWidths.h +++ b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalMCWidths.h @@ -9,6 +9,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h" @@ -92,6 +93,10 @@ class HcalPedestalMCWidths : public edm::EDAnalyzer TFile *theFile; bool firsttime; bool histflag; + + edm::InputTag hbheDigiCollectionTag_; + edm::InputTag hoDigiCollectionTag_; + edm::InputTag hfDigiCollectionTag_; }; #endif diff --git a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalWidthsValidation.h b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalWidthsValidation.h index 768eb16f35b68..2ad4df597cb58 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalWidthsValidation.h +++ b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalWidthsValidation.h @@ -9,6 +9,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h" @@ -105,6 +106,10 @@ class HcalPedestalWidthsValidation : public edm::EDAnalyzer HcalPedestalWidths* rawWidthsItem; HcalPedestals* rawPedsItemfc; HcalPedestalWidths* rawWidthsItemfc; + + edm::InputTag hbheDigiCollectionTag_; + edm::InputTag hoDigiCollectionTag_; + edm::InputTag hfDigiCollectionTag_; }; #endif diff --git a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalsAnalysis.h b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalsAnalysis.h index a6e0b5e2f5749..7fc911be20d36 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalsAnalysis.h +++ b/trunk/CalibCalorimetry/HcalStandardModules/interface/HcalPedestalsAnalysis.h @@ -1,5 +1,3 @@ -// $Id: HcalPedestalsAnalysis.h,v 1.11 2009/11/24 15:54:38 devildog Exp $ - #ifndef HcalPedestalsAnalysis_H #define HcalPedestalsAnalysis_H @@ -11,6 +9,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h" @@ -76,7 +75,6 @@ class HcalPedestalsAnalysis : public edm::EDAnalyzer virtual ~HcalPedestalsAnalysis(); //Analysis void analyze(const edm::Event & event, const edm::EventSetup& eventSetup); - virtual void endJob(); private: //Container for data, 1 per channel @@ -88,7 +86,6 @@ class HcalPedestalsAnalysis : public edm::EDAnalyzer int runnum; int firstTS; int lastTS; - int ievt; std::string ROOTfilename; std::string pedsADCfilename; std::string pedsfCfilename; @@ -112,6 +109,10 @@ class HcalPedestalsAnalysis : public edm::EDAnalyzer HcalPedestalWidths* rawWidthsItem; HcalPedestals* rawPedsItemfc; HcalPedestalWidths* rawWidthsItemfc; + + edm::InputTag hbheDigiCollectionTag_; + edm::InputTag hoDigiCollectionTag_; + edm::InputTag hfDigiCollectionTag_; }; #endif diff --git a/trunk/CalibCalorimetry/HcalStandardModules/src/HFLightCal.cc b/trunk/CalibCalorimetry/HcalStandardModules/src/HFLightCal.cc index baad946a39aa7..156184937dc69 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/src/HFLightCal.cc +++ b/trunk/CalibCalorimetry/HcalStandardModules/src/HFLightCal.cc @@ -41,7 +41,10 @@ namespace { bool verbose = false; } -HFLightCal::HFLightCal (const edm::ParameterSet& fConfiguration) { +HFLightCal::HFLightCal (const edm::ParameterSet& fConfiguration) : + hfDigiCollectionTag_(fConfiguration.getParameter("hfDigiCollectionTag")), + hcalCalibDigiCollectionTag_(fConfiguration.getParameter("hcalCalibDigiCollectionTag")) { + //std::string histfile = fConfiguration.getUntrackedParameter("rootFile"); histfile = fConfiguration.getUntrackedParameter("rootFile"); textfile = fConfiguration.getUntrackedParameter("textFile"); @@ -425,7 +428,7 @@ void HFLightCal::analyze(const edm::Event& fEvent, const edm::EventSetup& fSetup // HF PIN-diodes edm::Handle calib; - fEvent.getByType(calib); + fEvent.getByLabel(hcalCalibDigiCollectionTag_, calib); if (verbose) std::cout<<"Analysis-> total CAL digis= "<size()< hf_digi; - fEvent.getByType(hf_digi); + fEvent.getByLabel(hfDigiCollectionTag_, hf_digi); if (verbose) std::cout<<"Analysis-> total HF digis= "<size()<size (); ++ihit) { diff --git a/trunk/CalibCalorimetry/HcalStandardModules/src/HFLightCalRand.cc b/trunk/CalibCalorimetry/HcalStandardModules/src/HFLightCalRand.cc index 608f159ef3199..f33eb6ca95061 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/src/HFLightCalRand.cc +++ b/trunk/CalibCalorimetry/HcalStandardModules/src/HFLightCalRand.cc @@ -40,7 +40,10 @@ namespace { bool verbose = false; } -HFLightCalRand::HFLightCalRand (const edm::ParameterSet& fConfiguration) { +HFLightCalRand::HFLightCalRand (const edm::ParameterSet& fConfiguration) : + hfDigiCollectionTag_(fConfiguration.getParameter("hfDigiCollectionTag")), + hcalCalibDigiCollectionTag_(fConfiguration.getParameter("hcalCalibDigiCollectionTag")) { + //std::string histfile = fConfiguration.getUntrackedParameter("rootFile"); histfile = fConfiguration.getUntrackedParameter("rootFile"); textfile = fConfiguration.getUntrackedParameter("textFile"); @@ -384,7 +387,7 @@ void HFLightCalRand::analyze(const edm::Event& fEvent, const edm::EventSetup& fS // HF PIN-diodes edm::Handle calib; - fEvent.getByType(calib); + fEvent.getByLabel(hcalCalibDigiCollectionTag_, calib); if (verbose) std::cout<<"Analysis-> total CAL digis= "<size()< hf_digi; - fEvent.getByType(hf_digi); + fEvent.getByLabel(hfDigiCollectionTag_, hf_digi); if (verbose) std::cout<<"Analysis-> total HF digis= "<size()<size (); ++ihit) { diff --git a/trunk/CalibCalorimetry/HcalStandardModules/src/HFPreLightCal.cc b/trunk/CalibCalorimetry/HcalStandardModules/src/HFPreLightCal.cc index 8829095a062ce..951e716d73995 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/src/HFPreLightCal.cc +++ b/trunk/CalibCalorimetry/HcalStandardModules/src/HFPreLightCal.cc @@ -35,7 +35,10 @@ namespace { bool verbose = false; } -HFPreLightCal::HFPreLightCal (const edm::ParameterSet& fConfiguration) { +HFPreLightCal::HFPreLightCal (const edm::ParameterSet& fConfiguration) : + hfDigiCollectionTag_(fConfiguration.getParameter("hfDigiCollectionTag")), + hcalCalibDigiCollectionTag_(fConfiguration.getParameter("hcalCalibDigiCollectionTag")) { + //std::string histfile = fConfiguration.getUntrackedParameter("rootFile"); histfile = fConfiguration.getUntrackedParameter("rootPreFile"); textfile = fConfiguration.getUntrackedParameter("textPreFile"); @@ -134,7 +137,7 @@ void HFPreLightCal::analyze(const edm::Event& fEvent, const edm::EventSetup& fSe // HF PIN-diodes edm::Handle calib; - fEvent.getByType(calib); + fEvent.getByLabel(hcalCalibDigiCollectionTag_, calib); if (verbose) std::cout<<"Analysis-> total CAL digis= "<size()< hf_digi; - fEvent.getByType(hf_digi); + fEvent.getByLabel(hfDigiCollectionTag_, hf_digi); if (verbose) std::cout<<"Analysis-> total HF digis= "<size()<size (); ++ihit) { diff --git a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalLedAnalyzer.cc b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalLedAnalyzer.cc index ca0d38a8d16f6..1952e8ad55c97 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalLedAnalyzer.cc +++ b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalLedAnalyzer.cc @@ -49,7 +49,12 @@ namespace { } -HcalLedAnalyzer::HcalLedAnalyzer(const edm::ParameterSet& ps){ +HcalLedAnalyzer::HcalLedAnalyzer(const edm::ParameterSet& ps) : + hbheDigiCollectionTag_(ps.getParameter("hbheDigiCollectionTag")), + hoDigiCollectionTag_(ps.getParameter("hoDigiCollectionTag")), + hfDigiCollectionTag_(ps.getParameter("hfDigiCollectionTag")), + hcalCalibDigiCollectionTag_ (ps.getParameter("hcalCalibDigiCollectionTag")) { + m_ledAnal = new HcalLedAnalysis(ps); m_ledAnal->LedSetup(ps.getUntrackedParameter("outputFileHist", "HcalLedAnalyzer.root")); // m_startSample = ps.getUntrackedParameter("firstSample", 0); @@ -94,12 +99,12 @@ void HcalLedAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& eventS m_ievt++; ///get digis - edm::Handle hbhe; e.getByType(hbhe); - edm::Handle ho; e.getByType(ho); - edm::Handle hf; e.getByType(hf); + edm::Handle hbhe; e.getByLabel(hbheDigiCollectionTag_, hbhe); + edm::Handle ho; e.getByLabel(hoDigiCollectionTag_, ho); + edm::Handle hf; e.getByLabel(hfDigiCollectionTag_, hf); // get calib digis - edm::Handle calib; e.getByType(calib); + edm::Handle calib; e.getByLabel(hcalCalibDigiCollectionTag_, calib); // get testbeam specific laser info from the TDC. This probably will not work // outside of the testbeam, but it should be easy to modify the Handle/getByType diff --git a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalAnalyzer.cc b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalAnalyzer.cc index 9203189c2d405..d7ec675b861dc 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalAnalyzer.cc +++ b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalAnalyzer.cc @@ -13,8 +13,8 @@ /* * \file HcalPedestalAnalyzer.cc * - * $Date: 2009/12/17 21:09:32 $ - * $Revision: 1.13 $ + * $Date: 2010/02/25 00:28:13 $ + * $Revision: 1.14 $ * \author S Stoynev / W Fisher * */ @@ -102,7 +102,10 @@ namespace { } } -HcalPedestalAnalyzer::HcalPedestalAnalyzer(const edm::ParameterSet& ps){ +HcalPedestalAnalyzer::HcalPedestalAnalyzer(const edm::ParameterSet& ps) : + hbheDigiCollectionTag_(ps.getParameter("hbheDigiCollectionTag")), + hoDigiCollectionTag_(ps.getParameter("hoDigiCollectionTag")), + hfDigiCollectionTag_(ps.getParameter("hfDigiCollectionTag")) { m_pedAnal = new HcalPedestalAnalysis(ps); m_pedAnal->setup(ps.getUntrackedParameter("outputFileHist", "HcalPedestalAnalyzer.root")); @@ -196,9 +199,9 @@ void HcalPedestalAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& e m_ievt++; ///get digis - edm::Handle hbhe; e.getByType(hbhe); - edm::Handle ho; e.getByType(ho); - edm::Handle hf; e.getByType(hf); + edm::Handle hbhe; e.getByLabel(hbheDigiCollectionTag_, hbhe); + edm::Handle ho; e.getByLabel(hoDigiCollectionTag_, ho); + edm::Handle hf; e.getByLabel(hfDigiCollectionTag_, hf); // get conditions edm::ESHandle conditions; diff --git a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalMCWidths.cc b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalMCWidths.cc index bd384f4aa29cb..415123e6f4145 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalMCWidths.cc +++ b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalMCWidths.cc @@ -7,8 +7,11 @@ #include #include "CalibCalorimetry/HcalStandardModules/interface/HcalPedestalMCWidths.h" -HcalPedestalMCWidths::HcalPedestalMCWidths(const edm::ParameterSet& ps) -{ +HcalPedestalMCWidths::HcalPedestalMCWidths(const edm::ParameterSet& ps) : + hbheDigiCollectionTag_(ps.getParameter("hbheDigiCollectionTag")), + hoDigiCollectionTag_(ps.getParameter("hoDigiCollectionTag")), + hfDigiCollectionTag_(ps.getParameter("hfDigiCollectionTag")) { + firsttime = true; histflag = ps.getUntrackedParameter("saveHists",true); } @@ -102,9 +105,9 @@ HcalPedestalMCWidths::analyze(const edm::Event& e, const edm::EventSetup& iSetup using namespace edm; using namespace std; - edm::Handle hbhe; e.getByType(hbhe); - edm::Handle ho; e.getByType(ho); - edm::Handle hf; e.getByType(hf); + edm::Handle hbhe; e.getByLabel(hbheDigiCollectionTag_, hbhe); + edm::Handle ho; e.getByLabel(hoDigiCollectionTag_, ho); + edm::Handle hf; e.getByLabel(hfDigiCollectionTag_, hf); edm::ESHandle conditions; iSetup.get().get(conditions); diff --git a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalWidthsValidation.cc b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalWidthsValidation.cc index c52e60d7ba9cf..05400e7e06126 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalWidthsValidation.cc +++ b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalWidthsValidation.cc @@ -7,8 +7,11 @@ #include #include "CalibCalorimetry/HcalStandardModules/interface/HcalPedestalWidthsValidation.h" -HcalPedestalWidthsValidation::HcalPedestalWidthsValidation(const edm::ParameterSet& ps) -{ +HcalPedestalWidthsValidation::HcalPedestalWidthsValidation(const edm::ParameterSet& ps) : + hbheDigiCollectionTag_(ps.getParameter("hbheDigiCollectionTag")), + hoDigiCollectionTag_(ps.getParameter("hoDigiCollectionTag")), + hfDigiCollectionTag_(ps.getParameter("hfDigiCollectionTag")) { + firstTS = ps.getUntrackedParameter("firstTS", 0); lastTS = ps.getUntrackedParameter("lastTS", 9); firsttime = true; @@ -201,10 +204,9 @@ HcalPedestalWidthsValidation::~HcalPedestalWidthsValidation() void HcalPedestalWidthsValidation::analyze(const edm::Event& e, const edm::EventSetup& iSetup) { - - edm::Handle hbhe; e.getByType(hbhe); - edm::Handle ho; e.getByType(ho); - edm::Handle hf; e.getByType(hf); + edm::Handle hbhe; e.getByLabel(hbheDigiCollectionTag_, hbhe); + edm::Handle ho; e.getByLabel(hoDigiCollectionTag_, ho); + edm::Handle hf; e.getByLabel(hfDigiCollectionTag_, hf); edm::ESHandle conditions; iSetup.get().get(conditions); diff --git a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalsAnalysis.cc b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalsAnalysis.cc index 6d6b6f066f034..2d1487caea71f 100644 --- a/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalsAnalysis.cc +++ b/trunk/CalibCalorimetry/HcalStandardModules/src/HcalPedestalsAnalysis.cc @@ -4,21 +4,20 @@ // This code runs 1000x faster and produces all outputs from a single run // (ADC, fC in .txt plus an .xml file) // -// $Id: HcalPedestalsAnalysis.cc,v 1.20 2009/11/24 15:54:21 devildog Exp $ - #include #include "CalibCalorimetry/HcalStandardModules/interface/HcalPedestalsAnalysis.h" -HcalPedestalsAnalysis::HcalPedestalsAnalysis(const edm::ParameterSet& ps) -{ - std::cout << "Code version 10.6\n"; +HcalPedestalsAnalysis::HcalPedestalsAnalysis(const edm::ParameterSet& ps) : + hbheDigiCollectionTag_(ps.getParameter("hbheDigiCollectionTag")), + hoDigiCollectionTag_(ps.getParameter("hoDigiCollectionTag")), + hfDigiCollectionTag_(ps.getParameter("hfDigiCollectionTag")) { + hiSaveFlag = ps.getUntrackedParameter("hiSaveFlag", false); dumpXML = ps.getUntrackedParameter("dumpXML", true); verboseflag = ps.getUntrackedParameter("verbose", false); firstTS = ps.getUntrackedParameter("firstTS", 0); lastTS = ps.getUntrackedParameter("lastTS", 9); firsttime = true; - ievt = 0; rawPedsItem = new HcalPedestals(true); rawWidthsItem = new HcalPedestalWidths(true); @@ -28,18 +27,7 @@ HcalPedestalsAnalysis::HcalPedestalsAnalysis(const edm::ParameterSet& ps) HcalPedestalsAnalysis::~HcalPedestalsAnalysis() -{} - -void HcalPedestalsAnalysis::endJob() { -// std::cout << "NEvents " << ievt << std::endl; - if(ievt < 1000) return; - std::string ievt_string; - std::stringstream tempstringout; - tempstringout << ievt; - ievt_string = tempstringout.str(); - pedsADCfilename += ievt_string; - pedsADCfilename += ".txt"; //Calculate pedestal constants std::cout << "Calculating Pedestal constants...\n"; std::vector::iterator bunch_it; @@ -57,39 +45,28 @@ void HcalPedestalsAnalysis::endJob() if(bunch_it->num[1][1]!=0) bunch_it->capfc[1] /= bunch_it->num[1][1]; if(bunch_it->num[2][2]!=0) bunch_it->capfc[2] /= bunch_it->num[2][2]; if(bunch_it->num[3][3]!=0) bunch_it->capfc[3] /= bunch_it->num[3][3]; - bunch_it->sig[0][0] = (bunch_it->prod[0][0]/bunch_it->num[0][0])-(bunch_it->cap[0]*bunch_it->cap[0]); - bunch_it->sig[0][1] = (bunch_it->prod[0][1]/bunch_it->num[0][1])-(bunch_it->cap[0]*bunch_it->cap[1]); - bunch_it->sig[0][2] = (bunch_it->prod[0][2]/bunch_it->num[0][2])-(bunch_it->cap[0]*bunch_it->cap[2]); - bunch_it->sig[0][3] = (bunch_it->prod[0][3]/bunch_it->num[0][3])-(bunch_it->cap[0]*bunch_it->cap[3]); - bunch_it->sig[1][0] = (bunch_it->prod[1][0]/bunch_it->num[1][0])-(bunch_it->cap[1]*bunch_it->cap[0]); - bunch_it->sig[1][1] = (bunch_it->prod[1][1]/bunch_it->num[1][1])-(bunch_it->cap[1]*bunch_it->cap[1]); - bunch_it->sig[1][2] = (bunch_it->prod[1][2]/bunch_it->num[1][2])-(bunch_it->cap[1]*bunch_it->cap[2]); - bunch_it->sig[1][3] = (bunch_it->prod[1][3]/bunch_it->num[1][3])-(bunch_it->cap[1]*bunch_it->cap[3]); - bunch_it->sig[2][0] = (bunch_it->prod[2][0]/bunch_it->num[2][0])-(bunch_it->cap[2]*bunch_it->cap[0]); - bunch_it->sig[2][1] = (bunch_it->prod[2][1]/bunch_it->num[2][1])-(bunch_it->cap[2]*bunch_it->cap[1]); - bunch_it->sig[2][2] = (bunch_it->prod[2][2]/bunch_it->num[2][2])-(bunch_it->cap[2]*bunch_it->cap[2]); - bunch_it->sig[2][3] = (bunch_it->prod[2][3]/bunch_it->num[2][3])-(bunch_it->cap[2]*bunch_it->cap[3]); - bunch_it->sig[3][0] = (bunch_it->prod[3][0]/bunch_it->num[3][0])-(bunch_it->cap[3]*bunch_it->cap[0]); - bunch_it->sig[3][1] = (bunch_it->prod[3][1]/bunch_it->num[3][1])-(bunch_it->cap[3]*bunch_it->cap[1]); - bunch_it->sig[3][2] = (bunch_it->prod[3][2]/bunch_it->num[3][2])-(bunch_it->cap[3]*bunch_it->cap[2]); - bunch_it->sig[3][3] = (bunch_it->prod[3][3]/bunch_it->num[3][3])-(bunch_it->cap[3]*bunch_it->cap[3]); + //widths are the covariance matrix--assumed symmetric + bunch_it->sig[0][0] = (bunch_it->prod[0][0]/bunch_it->num[0][0])-(bunch_it->cap[0])*(bunch_it->cap[0]); + bunch_it->sig[1][1] = (bunch_it->prod[1][1]/bunch_it->num[1][1])-(bunch_it->cap[1])*(bunch_it->cap[1]); + bunch_it->sig[2][2] = (bunch_it->prod[2][2]/bunch_it->num[2][2])-(bunch_it->cap[2])*(bunch_it->cap[2]); + bunch_it->sig[3][3] = (bunch_it->prod[3][3]/bunch_it->num[3][3])-(bunch_it->cap[3])*(bunch_it->cap[3]); + bunch_it->sig[0][1] = (bunch_it->prod[0][1])/(bunch_it->num[0][1])-(bunch_it->cap[0]*bunch_it->cap[1]); + bunch_it->sig[0][2] = (bunch_it->prod[0][2])/(bunch_it->num[0][2])-(bunch_it->cap[0]*bunch_it->cap[2]); + bunch_it->sig[0][3] = (bunch_it->prod[3][0])/(bunch_it->num[3][0])-(bunch_it->cap[0]*bunch_it->cap[3]); // sig03 MISNAMED in object! + bunch_it->sig[1][2] = (bunch_it->prod[1][2])/(bunch_it->num[1][2])-(bunch_it->cap[1]*bunch_it->cap[2]); + bunch_it->sig[1][3] = (bunch_it->prod[1][3])/(bunch_it->num[1][3])-(bunch_it->cap[1]*bunch_it->cap[3]); + bunch_it->sig[2][3] = (bunch_it->prod[2][3])/(bunch_it->num[2][3])-(bunch_it->cap[2]*bunch_it->cap[3]); - bunch_it->sigfc[0][0] = (bunch_it->prodfc[0][0]/bunch_it->num[0][0])-(bunch_it->capfc[0]*bunch_it->capfc[0]); - bunch_it->sigfc[0][1] = (bunch_it->prodfc[0][1]/bunch_it->num[0][1])-(bunch_it->capfc[0]*bunch_it->capfc[1]); - bunch_it->sigfc[0][2] = (bunch_it->prodfc[0][2]/bunch_it->num[0][2])-(bunch_it->capfc[0]*bunch_it->capfc[2]); - bunch_it->sigfc[0][3] = (bunch_it->prodfc[0][3]/bunch_it->num[0][3])-(bunch_it->capfc[0]*bunch_it->capfc[3]); - bunch_it->sigfc[1][0] = (bunch_it->prodfc[1][0]/bunch_it->num[1][0])-(bunch_it->capfc[1]*bunch_it->capfc[0]); - bunch_it->sigfc[1][1] = (bunch_it->prodfc[1][1]/bunch_it->num[1][1])-(bunch_it->capfc[1]*bunch_it->capfc[1]); - bunch_it->sigfc[1][2] = (bunch_it->prodfc[1][2]/bunch_it->num[1][2])-(bunch_it->capfc[1]*bunch_it->capfc[2]); - bunch_it->sigfc[1][3] = (bunch_it->prodfc[1][3]/bunch_it->num[1][3])-(bunch_it->capfc[1]*bunch_it->capfc[3]); - bunch_it->sigfc[2][0] = (bunch_it->prodfc[2][0]/bunch_it->num[2][0])-(bunch_it->capfc[2]*bunch_it->capfc[0]); - bunch_it->sigfc[2][1] = (bunch_it->prodfc[2][1]/bunch_it->num[2][1])-(bunch_it->capfc[2]*bunch_it->capfc[1]); - bunch_it->sigfc[2][2] = (bunch_it->prodfc[2][2]/bunch_it->num[2][2])-(bunch_it->capfc[2]*bunch_it->capfc[2]); - bunch_it->sigfc[2][3] = (bunch_it->prodfc[2][3]/bunch_it->num[2][3])-(bunch_it->capfc[2]*bunch_it->capfc[3]); - bunch_it->sigfc[3][0] = (bunch_it->prodfc[3][0]/bunch_it->num[3][0])-(bunch_it->capfc[3]*bunch_it->capfc[0]); - bunch_it->sigfc[3][1] = (bunch_it->prodfc[3][1]/bunch_it->num[3][1])-(bunch_it->capfc[3]*bunch_it->capfc[1]); - bunch_it->sigfc[3][2] = (bunch_it->prodfc[3][2]/bunch_it->num[3][2])-(bunch_it->capfc[3]*bunch_it->capfc[2]); - bunch_it->sigfc[3][3] = (bunch_it->prodfc[3][3]/bunch_it->num[3][3])-(bunch_it->capfc[3]*bunch_it->capfc[3]); + bunch_it->sigfc[0][0] = (bunch_it->prodfc[0][0]/bunch_it->num[0][0])-(bunch_it->capfc[0])*(bunch_it->capfc[0]); + bunch_it->sigfc[1][1] = (bunch_it->prodfc[1][1]/bunch_it->num[1][1])-(bunch_it->capfc[1])*(bunch_it->capfc[1]); + bunch_it->sigfc[2][2] = (bunch_it->prodfc[2][2]/bunch_it->num[2][2])-(bunch_it->capfc[2])*(bunch_it->capfc[2]); + bunch_it->sigfc[3][3] = (bunch_it->prodfc[3][3]/bunch_it->num[3][3])-(bunch_it->capfc[3])*(bunch_it->capfc[3]); + bunch_it->sigfc[0][1] = (bunch_it->prodfc[0][1]/(bunch_it->num[0][1]))-(bunch_it->capfc[0]*bunch_it->capfc[1]); + bunch_it->sigfc[0][2] = (bunch_it->prodfc[0][2]/(bunch_it->num[0][2]))-(bunch_it->capfc[0]*bunch_it->capfc[2]); + bunch_it->sigfc[0][3] = (bunch_it->prodfc[3][0]/(bunch_it->num[3][0]))-(bunch_it->capfc[0]*bunch_it->capfc[3]); //sig03 MISNAMED in object! + bunch_it->sigfc[1][2] = (bunch_it->prodfc[1][2]/(bunch_it->num[1][2]))-(bunch_it->capfc[1]*bunch_it->capfc[2]); + bunch_it->sigfc[1][3] = (bunch_it->prodfc[1][3]/(bunch_it->num[1][3]))-(bunch_it->capfc[1]*bunch_it->capfc[3]); + bunch_it->sigfc[2][3] = (bunch_it->prodfc[2][3]/(bunch_it->num[2][3]))-(bunch_it->capfc[2]*bunch_it->capfc[3]); if(bunch_it->detid.subdet() == 1){ for(int i = 0; i != 4; i++){ @@ -116,8 +93,7 @@ void HcalPedestalsAnalysis::endJob() } } - const HcalPedestal item(bunch_it->detid, bunch_it->cap[0], bunch_it->cap[1], bunch_it->cap[2], bunch_it->cap[3], - bunch_it->sig[0][0], bunch_it->sig[1][1], bunch_it->sig[2][2], bunch_it->sig[3][3]); + const HcalPedestal item(bunch_it->detid, bunch_it->cap[0], bunch_it->cap[1], bunch_it->cap[2], bunch_it->cap[3]); rawPedsItem->addValues(item); HcalPedestalWidth widthsp(bunch_it->detid); widthsp.setSigma(0,0,bunch_it->sig[0][0]); @@ -132,8 +108,8 @@ void HcalPedestalsAnalysis::endJob() widthsp.setSigma(3,3,bunch_it->sig[3][3]); rawWidthsItem->addValues(widthsp); - const HcalPedestal itemfc(bunch_it->detid, bunch_it->capfc[0], bunch_it->capfc[1], bunch_it->capfc[2], bunch_it->capfc[3], - bunch_it->sigfc[0][0], bunch_it->sigfc[1][1], bunch_it->sigfc[2][2], bunch_it->sigfc[3][3]); + const HcalPedestal itemfc(bunch_it->detid, bunch_it->capfc[0], bunch_it->capfc[1], + bunch_it->capfc[2], bunch_it->capfc[3]); rawPedsItemfc->addValues(itemfc); HcalPedestalWidth widthspfc(bunch_it->detid); widthspfc.setSigma(0,0,bunch_it->sigfc[0][0]); @@ -153,19 +129,19 @@ void HcalPedestalsAnalysis::endJob() // dump the resulting list of pedestals into a file std::ofstream outStream1(pedsADCfilename.c_str()); HcalDbASCIIIO::dumpObject (outStream1, (*rawPedsItem) ); -// std::ofstream outStream2(widthsADCfilename.c_str()); -// HcalDbASCIIIO::dumpObject (outStream2, (*rawWidthsItem) ); -// -// std::ofstream outStream3(pedsfCfilename.c_str()); -// HcalDbASCIIIO::dumpObject (outStream3, (*rawPedsItemfc) ); -// std::ofstream outStream4(widthsfCfilename.c_str()); -// HcalDbASCIIIO::dumpObject (outStream4, (*rawWidthsItemfc) ); -// -// if(dumpXML){ -// std::ofstream outStream5(XMLfilename.c_str()); -// HcalDbXml::dumpObject (outStream5, runnum, 0, 2147483647, XMLtag, 1, (*rawPedsItem), (*rawWidthsItem)); -// } -// + std::ofstream outStream2(widthsADCfilename.c_str()); + HcalDbASCIIIO::dumpObject (outStream2, (*rawWidthsItem) ); + + std::ofstream outStream3(pedsfCfilename.c_str()); + HcalDbASCIIIO::dumpObject (outStream3, (*rawPedsItemfc) ); + std::ofstream outStream4(widthsfCfilename.c_str()); + HcalDbASCIIIO::dumpObject (outStream4, (*rawWidthsItemfc) ); + + if(dumpXML){ + std::ofstream outStream5(XMLfilename.c_str()); + HcalDbXml::dumpObject (outStream5, runnum, 0, 2147483647, XMLtag, 1, (*rawPedsItem), (*rawWidthsItem)); + } + if(hiSaveFlag){ theFile->Write(); }else{ @@ -204,9 +180,9 @@ HcalPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup& iSetu using namespace edm; using namespace std; - edm::Handle hbhe; e.getByType(hbhe); - edm::Handle ho; e.getByType(ho); - edm::Handle hf; e.getByType(hf); + edm::Handle hbhe; e.getByLabel(hbheDigiCollectionTag_, hbhe); + edm::Handle ho; e.getByLabel(hoDigiCollectionTag_, ho); + edm::Handle hf; e.getByLabel(hfDigiCollectionTag_, hf); edm::ESHandle conditions; iSetup.get().get(conditions); @@ -220,7 +196,7 @@ HcalPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup& iSetu tempstringout << runnum; runnum_string = tempstringout.str(); ROOTfilename = runnum_string + "-peds_ADC.root"; - pedsADCfilename = runnum_string + "-peds_ADC_"; + pedsADCfilename = runnum_string + "-peds_ADC.txt"; pedsfCfilename = runnum_string + "-peds_fC.txt"; widthsADCfilename = runnum_string + "-widths_ADC.txt"; widthsfCfilename = runnum_string + "-widths_fC.txt"; @@ -287,6 +263,7 @@ HcalPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup& iSetu bunch_it->usedflag = true; for(int ts = firstTS; ts != lastTS+1; ts++) { + if(digi.sample(ts).adc() > 15) continue; const HcalQIECoder* coder = conditions->getHcalCoder(digi.id().rawId()); bunch_it->num[digi.sample(ts).capid()][digi.sample(ts).capid()] += 1; bunch_it->cap[digi.sample(ts).capid()] += digi.sample(ts).adc(); @@ -295,18 +272,21 @@ HcalPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup& iSetu bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts).capid()] += (digi.sample(ts).adc() * digi.sample(ts).adc()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts).capid()] += charge1 * charge1; if((ts+1 < digi.size()) && (ts+1 < lastTS)){ + if(digi.sample(ts+1).adc() > 15) continue; bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += digi.sample(ts).adc()*digi.sample(ts+1).adc(); double charge2 = coder->charge(*shape, digi.sample(ts+1).adc(), digi.sample(ts+1).capid()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += charge1*charge2; bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += 1; } if((ts+2 < digi.size()) && (ts+2 < lastTS)){ + if(digi.sample(ts+2).adc() > 15) continue; bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += digi.sample(ts).adc()*digi.sample(ts+2).adc(); double charge2 = coder->charge(*shape, digi.sample(ts+2).adc(), digi.sample(ts+2).capid()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += charge1*charge2; bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += 1; } if((ts+3 < digi.size()) && (ts+3 < lastTS)){ + if(digi.sample(ts+3).adc() > 15) continue; bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += digi.sample(ts).adc()*digi.sample(ts+3).adc(); double charge2 = coder->charge(*shape, digi.sample(ts+3).adc(), digi.sample(ts+3).capid()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += charge1*charge2; @@ -323,6 +303,7 @@ HcalPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup& iSetu bunch_it->usedflag = true; for(int ts = firstTS; ts <= lastTS; ts++) { + if(digi.sample(ts).adc() > 15) continue; const HcalQIECoder* coder = conditions->getHcalCoder(digi.id().rawId()); bunch_it->num[digi.sample(ts).capid()][digi.sample(ts).capid()] += 1; bunch_it->cap[digi.sample(ts).capid()] += digi.sample(ts).adc(); @@ -331,18 +312,21 @@ HcalPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup& iSetu bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts).capid()] += (digi.sample(ts).adc() * digi.sample(ts).adc()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts).capid()] += charge1 * charge1; if((ts+1 < digi.size()) && (ts+1 < lastTS)){ + if(digi.sample(ts+1).adc() > 15) continue; bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += digi.sample(ts).adc()*digi.sample(ts+1).adc(); double charge2 = coder->charge(*shape, digi.sample(ts+1).adc(), digi.sample(ts+1).capid()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += charge1*charge2; bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += 1; } if((ts+2 < digi.size()) && (ts+2 < lastTS)){ + if(digi.sample(ts+2).adc() > 15) continue; bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += digi.sample(ts).adc()*digi.sample(ts+2).adc(); double charge2 = coder->charge(*shape, digi.sample(ts+2).adc(), digi.sample(ts+2).capid()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += charge1*charge2; bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += 1; } if((ts+3 < digi.size()) && (ts+3 < lastTS)){ + if(digi.sample(ts+3).adc() > 15) continue; bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += digi.sample(ts).adc()*digi.sample(ts+3).adc(); double charge2 = coder->charge(*shape, digi.sample(ts+3).adc(), digi.sample(ts+3).capid()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += charge1*charge2; @@ -359,6 +343,7 @@ HcalPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup& iSetu bunch_it->usedflag = true; for(int ts = firstTS; ts <= lastTS; ts++) { + if(digi.sample(ts).adc() > 15) continue; const HcalQIECoder* coder = conditions->getHcalCoder(digi.id().rawId()); bunch_it->num[digi.sample(ts).capid()][digi.sample(ts).capid()] += 1; bunch_it->cap[digi.sample(ts).capid()] += digi.sample(ts).adc(); @@ -367,18 +352,21 @@ HcalPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup& iSetu bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts).capid()] += (digi.sample(ts).adc() * digi.sample(ts).adc()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts).capid()] += charge1 * charge1; if((ts+1 < digi.size()) && (ts+1 < lastTS)){ + if(digi.sample(ts+1).adc() > 15) continue; bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += digi.sample(ts).adc()*digi.sample(ts+1).adc(); double charge2 = coder->charge(*shape, digi.sample(ts+1).adc(), digi.sample(ts+1).capid()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += charge1*charge2; bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += 1; } if((ts+2 < digi.size()) && (ts+2 < lastTS)){ + if(digi.sample(ts+2).adc() > 15) continue; bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += digi.sample(ts).adc()*digi.sample(ts+2).adc(); double charge2 = coder->charge(*shape, digi.sample(ts+2).adc(), digi.sample(ts+2).capid()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += charge1*charge2; bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += 1; } if((ts+3 < digi.size()) && (ts+3 < lastTS)){ + if(digi.sample(ts+3).adc() > 15) continue; bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += digi.sample(ts).adc()*digi.sample(ts+3).adc(); double charge2 = coder->charge(*shape, digi.sample(ts+3).adc(), digi.sample(ts+3).capid()); bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += charge1*charge2; @@ -388,7 +376,6 @@ HcalPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup& iSetu } //this is the last brace -ievt++; } //define this as a plug-in