CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
CSCTriggerPrimitivesReader Class Reference

#include <CSCTriggerPrimitivesReader.h>

Inheritance diagram for CSCTriggerPrimitivesReader:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 Does the job. More...
 
int chamberIX (CSCDetId id)
 
int chamberIXi (CSCDetId id)
 
int chamberSerial (CSCDetId id)
 
 CSCTriggerPrimitivesReader (const edm::ParameterSet &conf)
 Constructor. More...
 
void endJob () override
 Write to ROOT file, make plots, etc. More...
 
void HotWires (const edm::Event &iEvent)
 
 ~CSCTriggerPrimitivesReader () override
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

enum  { MAXPAGES = 20 }
 
enum  trig_cscs { MAX_ENDCAPS = 2, MAX_STATIONS = 4, CSC_TYPES = 10 }
 

Private Member Functions

void bookALCTHistos ()
 
void bookCLCTHistos ()
 
void bookCompHistos ()
 
void bookEfficHistos ()
 
void bookHotWireHistos ()
 
void bookLCTMPCHistos ()
 
void bookLCTTMBHistos ()
 
void bookResolHistos ()
 
void calcEfficiency (const CSCALCTDigiCollection *alcts, const CSCCLCTDigiCollection *clcts, const edm::PSimHitContainer &allSimHits)
 
void calcResolution (const CSCALCTDigiCollection *alcts, const CSCCLCTDigiCollection *clcts, const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const edm::PSimHitContainer &allSimHits)
 
void compare (const CSCALCTDigiCollection *alcts_data, const CSCALCTDigiCollection *alcts_emul, const CSCCLCTDigiCollection *clcts_data, const CSCCLCTDigiCollection *clcts_emul, const CSCCLCTPreTriggerDigiCollection *pretrigs_emul, const CSCCorrelatedLCTDigiCollection *lcts_data, const CSCCorrelatedLCTDigiCollection *lcts_emul)
 
void compareALCTs (const CSCALCTDigiCollection *alcts_data, const CSCALCTDigiCollection *alcts_emul)
 
void compareCLCTs (const CSCCLCTDigiCollection *clcts_data, const CSCCLCTDigiCollection *clcts_emul, const CSCCLCTPreTriggerDigiCollection *pretrigs_emul)
 
void compareLCTs (const CSCCorrelatedLCTDigiCollection *lcts_data, const CSCCorrelatedLCTDigiCollection *lcts_emul, const CSCALCTDigiCollection *alcts_data, const CSCCLCTDigiCollection *clcts_data)
 
void compareMPCLCTs (const CSCCorrelatedLCTDigiCollection *lcts_data, const CSCCorrelatedLCTDigiCollection *lcts_emul, const CSCALCTDigiCollection *alcts_data, const CSCCLCTDigiCollection *clcts_data)
 
int convertBXofLCT (const int emul_bx, const CSCDetId &detid, const CSCALCTDigiCollection *alcts_data, const CSCCLCTDigiCollection *clcts_data)
 
bool doesALCTCrossCLCT (CSCDetId id, int key_wg, int key_hs) const
 
void drawALCTHistos ()
 
void drawCLCTHistos ()
 
void drawCompHistos ()
 
void drawEfficHistos ()
 
void drawHistosForTalks ()
 
void drawLCTMPCHistos ()
 
void drawLCTTMBHistos ()
 
void drawResolHistos ()
 
void fillALCTHistos (const CSCALCTDigiCollection *alcts)
 
void fillCLCTHistos (const CSCCLCTDigiCollection *clcts)
 
void fillLCTMPCHistos (const CSCCorrelatedLCTDigiCollection *lcts)
 
void fillLCTTMBHistos (const CSCCorrelatedLCTDigiCollection *lcts)
 
int getCSCType (const CSCDetId &id)
 
GlobalPoint getGlobalPosition (unsigned int rawId, int keWg, int keyHS) const
 
double getHsPerRad (const int idh)
 
int maxRing (int station)
 
void MCStudies (const edm::Event &ev, const CSCALCTDigiCollection *alcts, const CSCCLCTDigiCollection *clcts)
 
void setRootStyle ()
 

Private Attributes

edm::EDGetTokenT< CSCALCTDigiCollectionalcts_d_token_
 
edm::EDGetTokenT< CSCALCTDigiCollectionalcts_e_token_
 
const CSCBadChambersbadChambers_
 
bool checkBadChambers_
 
edm::EDGetTokenT< CSCCLCTDigiCollectionclcts_d_token_
 
edm::EDGetTokenT< CSCCLCTDigiCollectionclcts_e_token_
 
edm::EDGetTokenT< CSCComparatorDigiCollectioncompDigi_token_
 
edm::InputTag compDigiProducer_
 
bool dataIsAnotherMC_
 
bool dataLctsIn_
 
bool debug
 
bool emulLctsIn_
 
int Event_
 
TTree * event_tree [6]
 
int eventsAnalyzed
 
bool gangedME1a
 
const CSCGeometrygeom_
 
TH1F * hAlctAccel
 
TH1F * hAlctBXN
 
TH1F * hAlctCollis
 
TH1F * hAlctCompFound
 
TH2F * hAlctCompFound2
 
TH2F * hAlctCompFound2i
 
TH2F * hAlctCompFound2x
 
TH1F * hAlctCompFoundCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hAlctCompMatch
 
TH2F * hAlctCompMatch2
 
TH2F * hAlctCompMatch2i
 
TH2F * hAlctCompMatch2x
 
TH1F * hAlctCompMatchCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hAlctCompSameN
 
TH2F * hAlctCompSameN2
 
TH2F * hAlctCompSameN2i
 
TH2F * hAlctCompSameN2x
 
TH1F * hAlctCompSameNCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hAlctCompTotal
 
TH2F * hAlctCompTotal2
 
TH2F * hAlctCompTotal2i
 
TH2F * hAlctCompTotal2x
 
TH1F * hAlctCompTotalCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hAlctCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hAlctKeyGroup
 
TH1F * hAlctKeyGroupME11
 
TH1F * hAlctPerChamber
 
TH1F * hAlctPerCSC
 
TH1F * hAlctPerEvent
 
TH1F * hAlctQuality
 
TH1F * hAlctValid
 
TH1F * hAlctVsEta [MAX_STATIONS]
 
TH1F * hClctBendCsc [CSC_TYPES][2]
 
TH1F * hClctBXN
 
TH1F * hClctCFEB
 
TH1F * hClctCompFound
 
TH2F * hClctCompFound2
 
TH2F * hClctCompFound2i
 
TH2F * hClctCompFound2x
 
TH1F * hClctCompFoundCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hClctCompMatch
 
TH2F * hClctCompMatch2
 
TH2F * hClctCompMatch2i
 
TH2F * hClctCompMatch2x
 
TH1F * hClctCompMatchCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hClctCompSameN
 
TH2F * hClctCompSameN2
 
TH2F * hClctCompSameN2i
 
TH2F * hClctCompSameN2x
 
TH1F * hClctCompSameNCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hClctCompTotal
 
TH2F * hClctCompTotal2
 
TH2F * hClctCompTotal2i
 
TH2F * hClctCompTotal2x
 
TH1F * hClctCompTotalCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hClctCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hClctKeyStrip [2]
 
TH1F * hClctKeyStripCsc [CSC_TYPES]
 
TH1F * hClctKeyStripME11
 
TH1F * hClctPattern [2]
 
TH1F * hClctPerChamber
 
TH1F * hClctPerCSC
 
TH1F * hClctPerEvent
 
TH1F * hClctQuality
 
TH1F * hClctSign
 
TH1F * hClctStripType
 
TH1F * hClctValid
 
TH1F * hClctVsPhi [MAX_STATIONS]
 
TH1F * hCorrLctMPCPerCSC
 
TH1F * hCorrLctTMBPerCSC
 
TH1F * hEfficALCTEta [MAX_STATIONS]
 
TH1F * hEfficALCTEtaCsc [CSC_TYPES]
 
TH1F * hEfficCLCTEta [MAX_STATIONS]
 
TH1F * hEfficCLCTEtaCsc [CSC_TYPES]
 
TH1F * hEfficHitsEta [MAX_STATIONS]
 
TH1F * hEfficHitsEtaCsc [CSC_TYPES]
 
TH1F * hEtaDiffCsc [CSC_TYPES][3]
 
TH1F * hEtaDiffVsEta [MAX_STATIONS]
 
TH2F * hEtaDiffVsWireCsc [CSC_TYPES]
 
TH2F * hEtaRecVsSim
 
TH1F * hHotCham1
 
TH1F * hHotWire1
 
TH1F * hLCTCompFound
 
TH2F * hLCTCompFound2
 
TH2F * hLCTCompFound2i
 
TH2F * hLCTCompFound2x
 
TH1F * hLctCompFoundCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hLCTCompMatch
 
TH2F * hLCTCompMatch2
 
TH2F * hLCTCompMatch2i
 
TH2F * hLCTCompMatch2x
 
TH1F * hLctCompMatchCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hLCTCompSameN
 
TH2F * hLCTCompSameN2
 
TH2F * hLCTCompSameN2i
 
TH2F * hLCTCompSameN2x
 
TH1F * hLctCompSameNCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hLCTCompTotal
 
TH2F * hLCTCompTotal2
 
TH2F * hLCTCompTotal2i
 
TH2F * hLCTCompTotal2x
 
TH1F * hLctCompTotalCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hLctMPCBend
 
TH1F * hLctMPCBXN
 
TH1F * hLctMPCChamber [MAX_STATIONS]
 
TH1F * hLctMPCEndcap
 
TH1F * hLctMPCKeyGroup
 
TH1F * hLctMPCKeyGroupME11
 
TH1F * hLctMPCKeyStrip
 
TH1F * hLctMPCKeyStripME11
 
TH1F * hLctMPCPattern
 
TH1F * hLctMPCPerCSC
 
TH1F * hLctMPCPerEvent
 
TH1F * hLctMPCQuality
 
TH1F * hLctMPCRing
 
TH1F * hLctMPCSector
 
TH1F * hLctMPCStation
 
TH1F * hLctMPCStripType
 
TH1F * hLctMPCValid
 
TH1F * hLctTMBBend
 
TH1F * hLctTMBBXN
 
TH1F * hLctTMBChamber [MAX_STATIONS]
 
TH1F * hLctTMBCsc [MAX_ENDCAPS][CSC_TYPES]
 
TH1F * hLctTMBEndcap
 
TH1F * hLctTMBKeyGroup
 
TH1F * hLctTMBKeyGroupME11
 
TH1F * hLctTMBKeyStrip
 
TH1F * hLctTMBKeyStripME11
 
TH1F * hLctTMBPattern
 
TH1F * hLctTMBPerChamber
 
TH1F * hLctTMBPerCSC
 
TH1F * hLctTMBPerEvent
 
TH1F * hLctTMBQuality
 
TH1F * hLctTMBRing
 
TH1F * hLctTMBSector
 
TH1F * hLctTMBStation
 
TH1F * hLctTMBStripType
 
TH1F * hLctTMBValid
 
TH1F * hPhiDiffCsc [CSC_TYPES][5]
 
TH1F * hPhiDiffPattern [CSCConstants::NUM_CLCT_PATTERNS]
 
TH1F * hPhiDiffVsPhi [MAX_STATIONS]
 
TH2F * hPhiDiffVsStripCsc [CSC_TYPES][2]
 
TH2F * hPhiRecVsSim
 
TH1F * hResolDeltaDS
 
TH1F * hResolDeltaEta
 
TH1F * hResolDeltaHS
 
TH1F * hResolDeltaPhi
 
TH1F * hResolDeltaPhiDS
 
TH1F * hResolDeltaPhiHS
 
TH1F * hResolDeltaWG
 
TH1F * hTrueBendCsc [CSC_TYPES]
 
std::string lctProducerData_
 
std::string lctProducerEmul_
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionlcts_mpc_d_token_
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionlcts_mpc_e_token_
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionlcts_tmb_d_token_
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionlcts_tmb_e_token_
 
std::string mpclctProducerData_
 
TreePerStub perStub [6]
 
bool plotME1A
 
bool plotME42
 
edm::EDGetTokenT< CSCCLCTPreTriggerDigiCollectionpretrigs_e_token_
 
std::string resultsFileNamesPrefix_
 
std::string rootFileName
 
int RUN_
 
edm::EDGetTokenT< edm::PSimHitContainersimHit_token_
 
edm::InputTag simHitProducer_
 
TTree * stub_tree [4]
 
MyStubComparison stubs_comparison [4]
 
edm::EDGetTokenT< CSCWireDigiCollectionwireDigi_token_
 
edm::InputTag wireDigiProducer_
 

Static Private Attributes

static bool bookedALCTHistos = false
 
static bool bookedCLCTHistos = false
 
static bool bookedCompHistos = false
 
static bool bookedEfficHistos = false
 
static bool bookedHotWireHistos = false
 
static bool bookedLCTMPCHistos = false
 
static bool bookedLCTTMBHistos = false
 
static bool bookedResolHistos = false
 
static const std::string csc_type [CSC_TYPES]
 
static const std::string csc_type_minus [CSC_TYPES]
 
static const std::string csc_type_plus [CSC_TYPES]
 
static const int lut_wg_vs_hs_me1a [48][2]
 
static const int lut_wg_vs_hs_me1ag [48][2]
 
static const int lut_wg_vs_hs_me1b [48][2]
 
static const int MAX_HS [CSC_TYPES]
 
static const int MAX_WG [CSC_TYPES]
 
static const int NCHAMBERS [CSC_TYPES] = {36, 36, 36, 36, 18, 36, 18, 36, 18, 36}
 
static int numALCT = 0
 
static int numCLCT = 0
 
static int numLCTMPC = 0
 
static int numLCTTMB = 0
 
static bool printps = false
 
static const int ptype_TMB07 [CSCConstants::NUM_CLCT_PATTERNS]
 
static const double TWOPI = 2. * M_PI
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Basic analyzer class which accesses ALCTs, CLCTs, and correlated LCTs and plot various quantities.

Author
Slava Valuev, UCLA.

Definition at line 121 of file CSCTriggerPrimitivesReader.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
MAXPAGES 

Definition at line 203 of file CSCTriggerPrimitivesReader.h.

203 { MAXPAGES = 20 }; // max. number of pages in postscript files

Constructor & Destructor Documentation

CSCTriggerPrimitivesReader::CSCTriggerPrimitivesReader ( const edm::ParameterSet conf)
explicit

Constructor.

Definition at line 275 of file CSCTriggerPrimitivesReader.cc.

References alcts_d_token_, alcts_e_token_, TreePerStub::bookTree(), MyStubComparison::bookTree(), checkBadChambers_, clcts_d_token_, clcts_e_token_, compDigi_token_, compDigiProducer_, dataIsAnotherMC_, dataLctsIn_, debug, emulLctsIn_, event_tree, gangedME1a, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLT_2018_cff::InputTag, lctProducerData_, lctProducerEmul_, lcts_mpc_d_token_, lcts_mpc_e_token_, lcts_tmb_d_token_, lcts_tmb_e_token_, mpclctProducerData_, perStub, plotME1A, plotME42, pretrigs_e_token_, printps, resultsFileNamesPrefix_, setRootStyle(), simHit_token_, simHitProducer_, stub_tree, stubs_comparison, wireDigi_token_, and wireDigiProducer_.

275  : eventsAnalyzed(0) {
277  // rootFileName = conf.getUntrackedParameter<string>("rootFileName","TPEHists.root");
278  // Create the root file for the histograms
279  // theFile = new TFile(rootFileName.c_str(), "RECREATE");
280  // theFile->cd();
281 
282  // Various input parameters.
283 
284  printps = conf.getParameter<bool>("printps");
285  dataLctsIn_ = conf.getParameter<bool>("dataLctsIn");
286  emulLctsIn_ = conf.getParameter<bool>("emulLctsIn");
287  edm::ParameterSet commonParams = conf.getParameter<edm::ParameterSet>("commonParam");
288 
289  // Switch for a new (2007) version of the TMB firmware.
290  gangedME1a = commonParams.getParameter<bool>("gangedME1a");
291 
292  // is it (non-upgrade algorithm) run along with upgrade one?
293  plotME1A = true;
294  plotME42 = true;
295  lctProducerData_ = conf.getUntrackedParameter<string>("CSCLCTProducerData", "cscunpacker");
296  mpclctProducerData_ = conf.getUntrackedParameter<string>("CSCMPCLCTProducerData", "csctfDigis");
297  lctProducerEmul_ = conf.getUntrackedParameter<string>("CSCLCTProducerEmul", "cscTriggerPrimitiveDigis");
298 
299  simHitProducer_ = conf.getParameter<edm::InputTag>("CSCSimHitProducer");
300  wireDigiProducer_ = conf.getParameter<edm::InputTag>("CSCWireDigiProducer");
301  compDigiProducer_ = conf.getParameter<edm::InputTag>("CSCComparatorDigiProducer");
302 
303  simHit_token_ = consumes<edm::PSimHitContainer>(simHitProducer_);
304  wireDigi_token_ = consumes<CSCWireDigiCollection>(wireDigiProducer_);
305  compDigi_token_ = consumes<CSCComparatorDigiCollection>(compDigiProducer_);
306 
307  alcts_d_token_ = consumes<CSCALCTDigiCollection>(edm::InputTag(lctProducerData_, "MuonCSCALCTDigi"));
308  clcts_d_token_ = consumes<CSCCLCTDigiCollection>(edm::InputTag(lctProducerData_, "MuonCSCCLCTDigi"));
310  consumes<CSCCorrelatedLCTDigiCollection>(edm::InputTag(lctProducerData_, "MuonCSCCorrelatedLCTDigi"));
311  lcts_mpc_d_token_ = consumes<CSCCorrelatedLCTDigiCollection>(edm::InputTag(mpclctProducerData_));
312 
313  alcts_e_token_ = consumes<CSCALCTDigiCollection>(edm::InputTag(lctProducerEmul_));
314  clcts_e_token_ = consumes<CSCCLCTDigiCollection>(edm::InputTag(lctProducerEmul_));
315  pretrigs_e_token_ = consumes<CSCCLCTPreTriggerDigiCollection>(edm::InputTag(lctProducerEmul_));
316  lcts_tmb_e_token_ = consumes<CSCCorrelatedLCTDigiCollection>(edm::InputTag(lctProducerEmul_));
317  lcts_mpc_e_token_ = consumes<CSCCorrelatedLCTDigiCollection>(edm::InputTag(lctProducerEmul_, "MPCSORTED"));
318 
319  consumesMany<edm::HepMCProduct>();
320  resultsFileNamesPrefix_ = conf.getUntrackedParameter<string>("resultsFileNamesPrefix", "");
321  checkBadChambers_ = conf.getUntrackedParameter<bool>("checkBadChambers", true);
322  debug = conf.getUntrackedParameter<bool>("debug", false);
323  dataIsAnotherMC_ = conf.getUntrackedParameter<bool>("dataIsAnotherMC", false);
324 
325  //rootFileName = conf.getUntrackedParameter<string>("rootFileName");
326  // Create the root file.
327  // Not sure we really need it - comment out for now. -Slava.
328  //theFile = new TFile(rootFileName.c_str(), "RECREATE");
329  //theFile->cd();
330  stub_tree[0] = stubs_comparison[0].bookTree(stub_tree[0], "alcttree");
331  stub_tree[1] = stubs_comparison[1].bookTree(stub_tree[1], "clcttree");
332  stub_tree[2] = stubs_comparison[2].bookTree(stub_tree[2], "lcttree");
333  stub_tree[3] = stubs_comparison[3].bookTree(stub_tree[3], "mpclcttree");
334  // Per event TTree
335  event_tree[0] = perStub[0].bookTree(event_tree[0], "Ev_alcttree");
336  event_tree[1] = perStub[1].bookTree(event_tree[1], "Ev_emul_alcttree");
337  event_tree[2] = perStub[2].bookTree(event_tree[2], "Ev_clcttree");
338  event_tree[3] = perStub[3].bookTree(event_tree[3], "Ev_emul_clcttree");
339  event_tree[4] = perStub[4].bookTree(event_tree[4], "Ev_lcttree");
340  event_tree[5] = perStub[5].bookTree(event_tree[5], "Ev_emul_lcttree");
341  // My favourite ROOT settings.
342  setRootStyle();
343 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< CSCALCTDigiCollection > alcts_e_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_tmb_e_token_
edm::EDGetTokenT< CSCWireDigiCollection > wireDigi_token_
edm::EDGetTokenT< CSCCLCTDigiCollection > clcts_e_token_
TTree * bookTree(TTree *t, const std::string &name="Stub_compare")
TTree * bookTree(TTree *t, const std::string &name="TreePerStub")
edm::EDGetTokenT< CSCALCTDigiCollection > alcts_d_token_
edm::EDGetTokenT< CSCComparatorDigiCollection > compDigi_token_
edm::EDGetTokenT< CSCCLCTDigiCollection > clcts_d_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_mpc_e_token_
edm::EDGetTokenT< edm::PSimHitContainer > simHit_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_mpc_d_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_tmb_d_token_
edm::EDGetTokenT< CSCCLCTPreTriggerDigiCollection > pretrigs_e_token_
CSCTriggerPrimitivesReader::~CSCTriggerPrimitivesReader ( )
override

Destructor.

Definition at line 348 of file CSCTriggerPrimitivesReader.cc.

348  {
349  // histos->writeHists(theFile);
350  // theFile->Close();
351  //delete theFile;
352 }

Member Function Documentation

void CSCTriggerPrimitivesReader::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
override

Does the job.

Definition at line 364 of file CSCTriggerPrimitivesReader.cc.

References alcts_d_token_, alcts_e_token_, badChambers_, checkBadChambers_, clcts_d_token_, clcts_e_token_, compare(), dataLctsIn_, emulLctsIn_, edm::EventID::event(), Event_, eventsAnalyzed, fillALCTHistos(), fillCLCTHistos(), fillLCTTMBHistos(), geom_, edm::EventSetup::get(), edm::Event::getByToken(), HotWires(), edm::EventBase::id(), edm::HandleBase::isValid(), lcts_mpc_d_token_, lcts_mpc_e_token_, lcts_tmb_d_token_, lcts_tmb_e_token_, LogTrace, MCStudies(), pretrigs_e_token_, edm::Handle< T >::product(), edm::ESHandle< T >::product(), edm::EventID::run(), and RUN_.

364  {
365  ++eventsAnalyzed;
366  //if (ev.id().event()%10 == 0)
367  LogTrace("CSCTriggerPrimitivesReader") << "\n** CSCTriggerPrimitivesReader: processing run #" << ev.id().run()
368  << " event #" << ev.id().event() << "; events so far: " << eventsAnalyzed
369  << " **";
370  RUN_ = ev.id().run();
371  Event_ = ev.id().event();
372 
373  // Find the geometry for this event & cache it. Needed in LCTAnalyzer
374  // modules.
376  setup.get<MuonGeometryRecord>().get(cscGeom);
377  geom_ = &*cscGeom;
378 
379  // Find conditions data for bad chambers & cache it. Needed for efficiency
380  // calculations.
381  if (checkBadChambers_) {
383  setup.get<CSCBadChambersRcd>().get(pBad);
384  badChambers_ = pBad.product();
385  }
386 
387  // Get the collections of ALCTs, CLCTs, and correlated LCTs from event.
397 
398  // Data
399  if (dataLctsIn_) {
400  HotWires(ev);
401  // ev.getByLabel(lctProducerData_, alcts_data);
402  // ev.getByLabel(lctProducerData_, clcts_data);
403  // ev.getByLabel(lctProducerData_, lcts_tmb_data);
404  ev.getByToken(alcts_d_token_, alcts_data);
405  ev.getByToken(clcts_d_token_, clcts_data);
406  ev.getByToken(lcts_tmb_d_token_, lcts_tmb_data);
407  ev.getByToken(lcts_mpc_d_token_, lcts_mpc_data);
408 
409  if (!alcts_data.isValid()) {
410  edm::LogWarning("L1CSCTPEmulatorWrongInput")
411  << "+++ Warning: Collection of ALCTs with label MuonCSCALCTDigi"
412  << " requested, but not found in the event... Skipping the rest +++\n";
413  return;
414  }
415  if (!clcts_data.isValid()) {
416  edm::LogWarning("L1CSCTPEmulatorWrongInput")
417  << "+++ Warning: Collection of CLCTs with label MuonCSCCLCTDigi"
418  << " requested, but not found in the event... Skipping the rest +++\n";
419  return;
420  }
421  if (!lcts_tmb_data.isValid()) {
422  edm::LogWarning("L1CSCTPEmulatorWrongInput") << "+++ Warning: Collection of correlated LCTs with label"
423  << " MuonCSCCorrelatedLCTDigi requested, but not found in the"
424  << " event... Skipping the rest +++\n";
425  return;
426  }
427  /*
428  if (!lcts_mpc_data.isValid()) {
429  edm::LogWarning("L1CSCTPEmulatorWrongInput")
430  << "+++ Warning: Collection of MPC correlated LCTs with label"
431  << " MuonCSCCorrelatedLCTDigi + MCPSorted requested, but not found in the"
432  << " event... Skipping the rest +++\n";
433  //return;
434  }*/
435  }
436 
437  // Emulator
438  if (emulLctsIn_) {
439  // ev.getByLabel(lctProducerEmul_, alcts_emul);
440  // ev.getByLabel(lctProducerEmul_, clcts_emul);
441  // ev.getByLabel(lctProducerEmul_, lcts_tmb_emul);
442  // ev.getByLabel(lctProducerEmul_, "MPCSORTED", lcts_mpc_emul);
443  ev.getByToken(alcts_e_token_, alcts_emul);
444  ev.getByToken(clcts_e_token_, clcts_emul);
445  ev.getByToken(pretrigs_e_token_, pretrigs_emul);
446  ev.getByToken(lcts_tmb_e_token_, lcts_tmb_emul);
447  ev.getByToken(lcts_mpc_e_token_, lcts_mpc_emul);
448 
449  if (!alcts_emul.isValid()) {
450  edm::LogWarning("L1CSCTPEmulatorWrongInput")
451  << "+++ Warning: Collection of emulated ALCTs"
452  << " requested, but not found in the event... Skipping the rest +++\n";
453  return;
454  }
455  if (!clcts_emul.isValid()) {
456  edm::LogWarning("L1CSCTPEmulatorWrongInput")
457  << "+++ Warning: Collection of emulated CLCTs"
458  << " requested, but not found in the event... Skipping the rest +++\n";
459  return;
460  }
461  if (!lcts_tmb_emul.isValid()) {
462  edm::LogWarning("L1CSCTPEmulatorWrongInput")
463  << "+++ Warning: Collection of emulated correlated LCTs"
464  << " requested, but not found in the event... Skipping the rest +++\n";
465  return;
466  }
467  /*
468  if (!lcts_mpc_emul.isValid()) {
469  edm::LogWarning("L1CSCTPEmulatorWrongInput")
470  << "+++ Warning: Collection of emulated correlated LCTs (MPCs)"
471  << " requested, but not found in the event... Skipping the rest +++\n";
472  //return;
473  }*/
474  }
475 
476  // Fill histograms with reconstructed or emulated quantities. If both are
477  // present, plot LCTs in data.
478  if (dataLctsIn_) {
479  fillALCTHistos(alcts_data.product());
480  fillCLCTHistos(clcts_data.product());
481  fillLCTTMBHistos(lcts_tmb_data.product());
482  } else if (emulLctsIn_) {
483  fillALCTHistos(alcts_emul.product());
484  fillCLCTHistos(clcts_emul.product());
485  fillLCTTMBHistos(lcts_tmb_emul.product());
486  //fillLCTMPCHistos(lcts_mpc_emul.product());
487  }
488 
489  // Compare LCTs in the data with the ones produced by the emulator.
490  if (dataLctsIn_ && emulLctsIn_) {
491  compare(alcts_data.product(),
492  alcts_emul.product(),
493  clcts_data.product(),
494  clcts_emul.product(),
495  pretrigs_emul.product(),
496  lcts_tmb_data.product(),
497  lcts_tmb_emul.product());
498  }
499  // Fill MC-based resolution/efficiency histograms, if needed.
500  if (emulLctsIn_) {
501  MCStudies(ev, alcts_emul.product(), clcts_emul.product());
502  }
503 } // analyze
void fillLCTTMBHistos(const CSCCorrelatedLCTDigiCollection *lcts)
edm::EDGetTokenT< CSCALCTDigiCollection > alcts_e_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_tmb_e_token_
void compare(const CSCALCTDigiCollection *alcts_data, const CSCALCTDigiCollection *alcts_emul, const CSCCLCTDigiCollection *clcts_data, const CSCCLCTDigiCollection *clcts_emul, const CSCCLCTPreTriggerDigiCollection *pretrigs_emul, const CSCCorrelatedLCTDigiCollection *lcts_data, const CSCCorrelatedLCTDigiCollection *lcts_emul)
bool ev
edm::EDGetTokenT< CSCCLCTDigiCollection > clcts_e_token_
void MCStudies(const edm::Event &ev, const CSCALCTDigiCollection *alcts, const CSCCLCTDigiCollection *clcts)
edm::EDGetTokenT< CSCALCTDigiCollection > alcts_d_token_
bool isValid() const
Definition: HandleBase.h:70
#define LogTrace(id)
T const * product() const
Definition: Handle.h:69
T get() const
Definition: EventSetup.h:73
edm::EDGetTokenT< CSCCLCTDigiCollection > clcts_d_token_
void fillCLCTHistos(const CSCCLCTDigiCollection *clcts)
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_mpc_e_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_mpc_d_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lcts_tmb_d_token_
void fillALCTHistos(const CSCALCTDigiCollection *alcts)
T const * product() const
Definition: ESHandle.h:86
void HotWires(const edm::Event &iEvent)
edm::EDGetTokenT< CSCCLCTPreTriggerDigiCollection > pretrigs_e_token_
void CSCTriggerPrimitivesReader::bookALCTHistos ( )
private

Definition at line 640 of file CSCTriggerPrimitivesReader.cc.

References bookedALCTHistos, gather_cfg::cout, csc_type_minus, csc_type_plus, CSC_TYPES, hAlctAccel, hAlctBXN, hAlctCollis, hAlctCsc, hAlctKeyGroup, hAlctKeyGroupME11, hAlctPerChamber, hAlctPerCSC, hAlctPerEvent, hAlctQuality, hAlctValid, mps_fire::i, dqmiolumiharvest::j, TFileService::make(), MAX_ENDCAPS, NCHAMBERS, and alignCSCRings::s.

Referenced by fillALCTHistos().

640  {
641  string s;
642 
644  hAlctPerEvent = fs->make<TH1F>("ALCTs_per_event", "ALCTs per event", 31, -0.5, 30.5);
645  hAlctPerChamber = fs->make<TH1F>("ALCTs_per_chamber", "ALCTs per chamber", 4, -0.5, 3.5);
646  hAlctPerCSC = fs->make<TH1F>("ALCTs_per_CSCtype", "ALCTs per CSC type", 10, -0.5, 9.5);
647  for (int i = 0; i < MAX_ENDCAPS; i++) { // endcaps
648  for (int j = 0; j < CSC_TYPES; j++) { // station/ring
649  float csc_max = NCHAMBERS[j] + 0.5;
650  char asdf[256];
651  sprintf(asdf, "ALCTs_%i", i * CSC_TYPES + j);
652  if (i == 0)
653  s = "ALCTs, " + csc_type_plus[j];
654  else
655  s = "ALCTs, " + csc_type_minus[j];
656  hAlctCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
657  }
658  }
659 
660  hAlctValid = fs->make<TH1F>("ALCT_validity", "ALCT validity", 3, -0.5, 2.5);
661  hAlctQuality = fs->make<TH1F>("ALCT_quality", "ALCT quality", 5, -0.5, 4.5);
662  hAlctAccel = fs->make<TH1F>("ALCT_accel_flag", "ALCT accel. flag", 3, -0.5, 2.5);
663  hAlctCollis = fs->make<TH1F>("ALCT_collision_flag", "ALCT collision. flag", 3, -0.5, 2.5);
664  hAlctKeyGroup = fs->make<TH1F>("ALCT_key_wiregroup", "ALCT key wiregroup", 120, -0.5, 119.5);
665  hAlctBXN = fs->make<TH1F>("ALCT_bx", "ALCT bx", 20, -0.5, 19.5);
666 
667  hAlctKeyGroupME11 = fs->make<TH1F>("hAlctKeyGroupME11", "ALCT key wiregroup ME1/1", 50, -0.5, 49.5);
668 
669  bookedALCTHistos = true;
670  std::cout << " bookedALCTHistos " << std::endl;
671 }
static const int NCHAMBERS[CSC_TYPES]
static const std::string csc_type_minus[CSC_TYPES]
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
TH1F * hAlctCsc[MAX_ENDCAPS][CSC_TYPES]
static const std::string csc_type_plus[CSC_TYPES]
void CSCTriggerPrimitivesReader::bookCLCTHistos ( )
private

Definition at line 673 of file CSCTriggerPrimitivesReader.cc.

References bookedCLCTHistos, gather_cfg::cout, csc_type, csc_type_minus, csc_type_plus, CSC_TYPES, hClctBendCsc, hClctBXN, hClctCFEB, hClctCsc, hClctKeyStrip, hClctKeyStripCsc, hClctKeyStripME11, hClctPattern, hClctPerChamber, hClctPerCSC, hClctPerEvent, hClctQuality, hClctSign, hClctStripType, hClctValid, mps_fire::i, dqmiolumiharvest::j, TFileService::make(), MAX_ENDCAPS, MAX_HS, NCHAMBERS, alignCSCRings::s, and indexGen::s2.

Referenced by fillCLCTHistos().

673  {
674  string s;
675 
677  hClctPerEvent = fs->make<TH1F>("CLCTs_per_event", "CLCTs per event", 31, -0.5, 30.5);
678  hClctPerChamber = fs->make<TH1F>("CLCTs_per_chamber", "CLCTs per chamber", 3, -0.5, 2.5);
679  hClctPerCSC = fs->make<TH1F>("CLCTs_per_CSCtype", "CLCTs per CSC type", 10, -0.5, 9.5);
680  for (int i = 0; i < MAX_ENDCAPS; i++) { // endcaps
681  for (int j = 0; j < CSC_TYPES; j++) { // station/ring
682  char asdf[256];
683  sprintf(asdf, "CLCTs_%i", i * CSC_TYPES + j);
684  float csc_max = NCHAMBERS[j] + 0.5;
685  if (i == 0)
686  s = "CLCTs, " + csc_type_plus[j];
687  else
688  s = "CLCTs, " + csc_type_minus[j];
689  hClctCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
690  }
691  }
692 
693  hClctValid = fs->make<TH1F>("CLCT_validity", "CLCT validity", 3, -0.5, 2.5);
694  hClctQuality = fs->make<TH1F>("CLCT_layers_hit", "CLCT layers hit", 9, -0.5, 8.5);
695  hClctStripType = fs->make<TH1F>("CLCT_strip_type", "CLCT strip type", 3, -0.5, 2.5);
696  hClctSign = fs->make<TH1F>("CLCT_sing_(L/R)", "CLCT sign (L/R)", 3, -0.5, 2.5);
697  hClctCFEB = fs->make<TH1F>("CLCT_cfeb_#", "CLCT cfeb #", 6, -0.5, 5.5);
698  hClctBXN = fs->make<TH1F>("CLCT_bx", "CLCT bx", 20, -0.5, 19.5);
699 
700  hClctKeyStrip[0] = fs->make<TH1F>("CLCT_keystrip_distrips", "CLCT keystrip, distrips", 40, -0.5, 39.5);
701  //hClctKeyStrip[0] = fs->make<TH1F>("","CLCT keystrip, distrips", 160, -0.5, 159.5);
702  hClctKeyStrip[1] = fs->make<TH1F>("CLCT_keystrip_halfstrips", "CLCT keystrip, halfstrips", 160, -0.5, 159.5);
703  hClctPattern[0] = fs->make<TH1F>("CLCT_pattern_distrips", "CLCT pattern, distrips", 13, -0.5, 12.5);
704  hClctPattern[1] = fs->make<TH1F>("CLCT_pattern_halfstrips", "CLCT pattern, halfstrips", 13, -0.5, 12.5);
705 
706  for (int i = 0; i < CSC_TYPES; i++) {
707  char asdf[256];
708  string s1 = "CLCT bend, " + csc_type[i];
709  sprintf(asdf, "CLCT_bend0_%i", i + 1);
710  hClctBendCsc[i][0] = fs->make<TH1F>(asdf, s1.c_str(), 5, -0.5, 4.5);
711  sprintf(asdf, "CLCT_bend1_%i", i + 1);
712  hClctBendCsc[i][1] = fs->make<TH1F>(asdf, s1.c_str(), 5, -0.5, 4.5);
713 
714  sprintf(asdf, "CLCT_keystrip_%i", i + 1);
715  string s2 = "CLCT keystrip, " + csc_type[i];
716  int max_ds = MAX_HS[i] / 4;
717  hClctKeyStripCsc[i] = fs->make<TH1F>(asdf, s2.c_str(), max_ds, 0., max_ds);
718  }
719 
720  hClctKeyStripME11 = fs->make<TH1F>("hClctKeyStripME11", "CLCT keystrip, halfstrips ME1/1", 161, -0.5, 160.5);
721 
722  bookedCLCTHistos = true;
723  std::cout << " bookedCLCTHistos " << std::endl;
724 }
static const int NCHAMBERS[CSC_TYPES]
static const std::string csc_type_minus[CSC_TYPES]
static const int MAX_HS[CSC_TYPES]
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
static const std::string csc_type[CSC_TYPES]
TH1F * hClctCsc[MAX_ENDCAPS][CSC_TYPES]
static const std::string csc_type_plus[CSC_TYPES]
void CSCTriggerPrimitivesReader::bookCompHistos ( )
private

Definition at line 866 of file CSCTriggerPrimitivesReader.cc.

References bookedCompHistos, gather_cfg::cout, csc_type_minus, csc_type_plus, CSC_TYPES, debug, hAlctCompFound, hAlctCompFound2, hAlctCompFound2i, hAlctCompFound2x, hAlctCompFoundCsc, hAlctCompMatch, hAlctCompMatch2, hAlctCompMatch2i, hAlctCompMatch2x, hAlctCompMatchCsc, hAlctCompSameN, hAlctCompSameN2, hAlctCompSameN2i, hAlctCompSameN2x, hAlctCompSameNCsc, hAlctCompTotal, hAlctCompTotal2, hAlctCompTotal2i, hAlctCompTotal2x, hAlctCompTotalCsc, hClctCompFound, hClctCompFound2, hClctCompFound2i, hClctCompFound2x, hClctCompFoundCsc, hClctCompMatch, hClctCompMatch2, hClctCompMatch2i, hClctCompMatch2x, hClctCompMatchCsc, hClctCompSameN, hClctCompSameN2, hClctCompSameN2i, hClctCompSameN2x, hClctCompSameNCsc, hClctCompTotal, hClctCompTotal2, hClctCompTotal2i, hClctCompTotal2x, hClctCompTotalCsc, hLCTCompFound, hLCTCompFound2, hLCTCompFound2i, hLCTCompFound2x, hLctCompFoundCsc, hLCTCompMatch, hLCTCompMatch2, hLCTCompMatch2i, hLCTCompMatch2x, hLctCompMatchCsc, hLCTCompSameN, hLCTCompSameN2, hLCTCompSameN2i, hLCTCompSameN2x, hLctCompSameNCsc, hLCTCompTotal, hLCTCompTotal2, hLCTCompTotal2i, hLCTCompTotal2x, hLctCompTotalCsc, mps_fire::i, dqmiolumiharvest::j, LogTrace, TFileService::make(), MAX_ENDCAPS, NCHAMBERS, and alignCSCRings::s.

Referenced by compare().

866  {
867  string s;
868 
870  // hAlctCompMatch;
871 
872  hAlctCompFound = fs->make<TH1F>("h_ALCT_found", "h_ALCT_found", 600, 0.5, 600.5);
873  hAlctCompFound2 = fs->make<TH2F>("h_ALCT_found2", "h_ALCT_found2", 19, -9.5, 9.5, 36, 0.5, 36.5);
874  hAlctCompFound2x = fs->make<TH2F>("h_ALCT_found2x", "h_ALCT_found2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
875 
876  hAlctCompSameN = fs->make<TH1F>("h_ALCT_SameN", "h_ALCT_SameN", 600, 0.5, 600.5);
877  hAlctCompSameN2 = fs->make<TH2F>("h_ALCT_SameN2", "h_ALCT_SameN2", 19, -9.5, 9.5, 36, 0.5, 36.5);
878  hAlctCompSameN2x = fs->make<TH2F>("h_ALCT_SameN2x", "h_ALCT_SameN2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
879 
880  hAlctCompMatch = fs->make<TH1F>("h_ALCT_match", "h_ALCT_match", 600, 0.5, 600.5);
881  hAlctCompMatch2 = fs->make<TH2F>("h_ALCT_match2", "h_ALCT_match2", 19, -9.5, 9.5, 36, 0.5, 36.5);
882  hAlctCompMatch2x = fs->make<TH2F>("h_ALCT_match2x", "h_ALCT_match2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
883 
884  hAlctCompTotal = fs->make<TH1F>("h_ALCT_total", "h_ALCT_total", 600, 0.5, 600.5);
885  hAlctCompTotal2 = fs->make<TH2F>("h_ALCT_total2", "h_ALCT_total2", 19, -9.5, 9.5, 36, 0.5, 36.5);
886  hAlctCompTotal2x = fs->make<TH2F>("h_ALCT_total2x", "h_ALCT_total2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
887 
888  hClctCompFound = fs->make<TH1F>("h_CLCT_found", "h_CLCT_found", 600, 0.5, 600.5);
889  hClctCompFound2 = fs->make<TH2F>("h_CLCT_found2", "h_CLCT_found2", 19, -9.5, 9.5, 36, 0.5, 36.5);
890  hClctCompFound2x = fs->make<TH2F>("h_CLCT_found2x", "h_CLCT_found2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
891 
892  hClctCompSameN = fs->make<TH1F>("h_CLCT_SameN", "h_CLCT_SameN", 600, 0.5, 600.5);
893  hClctCompSameN2 = fs->make<TH2F>("h_CLCT_SameN2", "h_CLCT_SameN2", 19, -9.5, 9.5, 36, 0.5, 36.5);
894  hClctCompSameN2x = fs->make<TH2F>("h_CLCT_SameN2x", "h_CLCT_SameN2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
895 
896  hClctCompMatch = fs->make<TH1F>("h_CLCT_match", "h_CLCT_match", 600, 0.5, 600.5);
897  hClctCompMatch2 = fs->make<TH2F>("h_CLCT_match2", "h_CLCT_match2", 19, -9.5, 9.5, 36, 0.5, 36.5);
898  hClctCompMatch2x = fs->make<TH2F>("h_CLCT_match2x", "h_CLCT_match2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
899 
900  hClctCompTotal = fs->make<TH1F>("h_CLCT_total", "h_CLCT_total", 600, 0.5, 600.5);
901  hClctCompTotal2 = fs->make<TH2F>("h_CLCT_total2", "h_CLCT_total2", 19, -9.5, 9.5, 36, 0.5, 36.5);
902  hClctCompTotal2x = fs->make<TH2F>("h_CLCT_total2x", "h_CLCT_total2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
903 
904  hLCTCompFound = fs->make<TH1F>("h_LCT_found", "h_LCT_found", 600, 0.5, 600.5);
905  hLCTCompFound2 = fs->make<TH2F>("h_LCT_found2", "h_LCT_found2", 19, -9.5, 9.5, 36, 0.5, 36.5);
906  hLCTCompFound2x = fs->make<TH2F>("h_LCT_found2x", "h_LCT_found2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
907 
908  hLCTCompSameN = fs->make<TH1F>("h_LCT_SameN", "h_LCT_SameN", 600, 0.5, 600.5);
909  hLCTCompSameN2 = fs->make<TH2F>("h_LCT_SameN2", "h_LCT_SameN2", 19, -9.5, 9.5, 36, 0.5, 36.5);
910  hLCTCompSameN2x = fs->make<TH2F>("h_LCT_SameN2x", "h_LCT_SameN2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
911 
912  hLCTCompMatch = fs->make<TH1F>("h_LCT_match", "h_LCT_match", 600, 0.5, 600.5);
913  hLCTCompMatch2 = fs->make<TH2F>("h_LCT_match2", "h_LCT_match2", 19, -9.5, 9.5, 36, 0.5, 36.5);
914  hLCTCompMatch2x = fs->make<TH2F>("h_LCT_match2x", "h_LCT_match2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
915 
916  hLCTCompTotal = fs->make<TH1F>("h_LCT_total", "h_LCT_total", 600, 0.5, 600.5);
917  hLCTCompTotal2 = fs->make<TH2F>("h_LCT_total2", "h_LCT_total2", 19, -9.5, 9.5, 36, 0.5, 36.5);
918  hLCTCompTotal2x = fs->make<TH2F>("h_LCT_total2x", "h_LCT_total2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
919 
920  //Chad's improved historgrams
921  hAlctCompFound2i = fs->make<TH2F>("h_ALCT_found2i", "h_ALCT_found2i", 18, 0, 18, 36, 0.5, 36.5);
922  hAlctCompSameN2i = fs->make<TH2F>("h_ALCT_SameN2i", "h_ALCT_SameN2i", 18, 0, 18, 36, 0.5, 36.5);
923  hAlctCompMatch2i = fs->make<TH2F>("h_ALCT_match2i", "h_ALCT_match2i", 18, 0, 18, 36, 0.5, 36.5);
924  hAlctCompTotal2i = fs->make<TH2F>("h_ALCT_total2i", "h_ALCT_total2i", 18, 0, 18, 36, 0.5, 36.5);
925  hClctCompFound2i = fs->make<TH2F>("h_CLCT_found2i", "h_CLCT_found2i", 18, 0, 18, 36, 0.5, 36.5);
926  hClctCompSameN2i = fs->make<TH2F>("h_CLCT_SameN2i", "h_CLCT_SameN2i", 18, 0, 18, 36, 0.5, 36.5);
927  hClctCompMatch2i = fs->make<TH2F>("h_CLCT_match2i", "h_CLCT_match2i", 18, 0, 18, 36, 0.5, 36.5);
928  hClctCompTotal2i = fs->make<TH2F>("h_CLCT_total2i", "h_CLCT_total2i", 18, 0, 18, 36, 0.5, 36.5);
929  hLCTCompFound2i = fs->make<TH2F>("h_LCT_found2i", "h_LCT_found2i", 18, 0, 18, 36, 0.5, 36.5);
930  hLCTCompSameN2i = fs->make<TH2F>("h_LCT_SameN2i", "h_LCT_SameN2i", 18, 0, 18, 36, 0.5, 36.5);
931  hLCTCompMatch2i = fs->make<TH2F>("h_LCT_match2i", "h_LCT_match2i", 18, 0, 18, 36, 0.5, 36.5);
932  hLCTCompTotal2i = fs->make<TH2F>("h_LCT_total2i", "h_LCT_total2i", 18, 0, 18, 36, 0.5, 36.5);
933 
934  // hAlctCompFound = fs->make<TH1F>("h_ALCT_found","h_ALCT_found",600,0.5,600.5);
935 
936  // ALCTs.
937  for (int i = 0; i < MAX_ENDCAPS; i++) { // endcaps
938  for (int j = 0; j < CSC_TYPES; j++) { // station/ring
939  char asdf[256];
940 
941  float csc_max = NCHAMBERS[j] + 0.5;
942  if (i == 0)
943  s = "Comp_ALCTs, " + csc_type_plus[j];
944  else
945  s = "Comp_ALCTs, " + csc_type_minus[j];
946  sprintf(asdf, "Comp_ALCTsFound_%i", i * CSC_TYPES + j);
947  hAlctCompFoundCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
948  sprintf(asdf, "Comp_ALCTsSame_%i", i * CSC_TYPES + j);
949  hAlctCompSameNCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
950  sprintf(asdf, "Comp_ALCTsTotal_%i", i * CSC_TYPES + j);
951  hAlctCompTotalCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
952  sprintf(asdf, "Comp_ALCTsMatch_%i", i * CSC_TYPES + j);
953  hAlctCompMatchCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
954  hAlctCompFoundCsc[i][j]->Sumw2();
955  hAlctCompSameNCsc[i][j]->Sumw2();
956  hAlctCompTotalCsc[i][j]->Sumw2();
957  hAlctCompMatchCsc[i][j]->Sumw2();
958  }
959  }
960 
961  // CLCTs.
962  for (int i = 0; i < MAX_ENDCAPS; i++) { // endcaps
963  for (int j = 0; j < CSC_TYPES; j++) { // station/ring
964  float csc_max = NCHAMBERS[j] + 0.5;
965  char asdf[256];
966  if (i == 0)
967  s = "Comp_CLCTs, " + csc_type_plus[j];
968  else
969  s = "Comp_CLCTs, " + csc_type_minus[j];
970  sprintf(asdf, "Comp_CLCTsFound_%i", i * CSC_TYPES + j);
971  hClctCompFoundCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
972  sprintf(asdf, "Comp_CLCTsSame_%i", i * CSC_TYPES + j);
973  hClctCompSameNCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
974  sprintf(asdf, "Comp_CLCTsTotal_%i", i * CSC_TYPES + j);
975  hClctCompTotalCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
976  sprintf(asdf, "Comp_CLCTsMatch_%i", i * CSC_TYPES + j);
977  hClctCompMatchCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
978  hClctCompFoundCsc[i][j]->Sumw2();
979  hClctCompSameNCsc[i][j]->Sumw2();
980  hClctCompTotalCsc[i][j]->Sumw2();
981  hClctCompMatchCsc[i][j]->Sumw2();
982  }
983  }
984 
985  // Correlated LCTs.
986  for (int i = 0; i < MAX_ENDCAPS; i++) { // endcaps
987  for (int j = 0; j < CSC_TYPES; j++) { // station/ring
988  float csc_max = NCHAMBERS[j] + 0.5;
989  char asdf[256];
990  if (i == 0)
991  s = "LCTs, " + csc_type_plus[j];
992  else
993  s = "LCTs, " + csc_type_minus[j];
994  sprintf(asdf, "LCTs_CompFound_%i", i * CSC_TYPES + j);
995  hLctCompFoundCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
996  sprintf(asdf, "LCTs_CompSame_%i", i * CSC_TYPES + j);
997  hLctCompSameNCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
998  sprintf(asdf, "LCTs_CompTotal_%i", i * CSC_TYPES + j);
999  hLctCompTotalCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
1000  sprintf(asdf, "LCTs_CompMatch_%i", i * CSC_TYPES + j);
1001  hLctCompMatchCsc[i][j] = fs->make<TH1F>(asdf, s.c_str(), NCHAMBERS[j], 0.5, csc_max);
1002  hLctCompFoundCsc[i][j]->Sumw2();
1003  hLctCompSameNCsc[i][j]->Sumw2();
1004  hLctCompTotalCsc[i][j]->Sumw2();
1005  hLctCompMatchCsc[i][j]->Sumw2();
1006  }
1007  }
1008 
1009  bookedCompHistos = true;
1010  if (debug)
1011  LogTrace("CSCTriggerPrimitivesReader") << "bookedCompHistos ";
1012  std::cout << "bookCompHistos " << std::endl;
1013 }
TH1F * hClctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
static const int NCHAMBERS[CSC_TYPES]
TH1F * hLctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hClctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hAlctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
static const std::string csc_type_minus[CSC_TYPES]
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
TH1F * hAlctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hClctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hAlctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hLctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hLctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
#define LogTrace(id)
TH1F * hAlctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hClctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hLctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
static const std::string csc_type_plus[CSC_TYPES]
void CSCTriggerPrimitivesReader::bookEfficHistos ( )
private

Definition at line 1096 of file CSCTriggerPrimitivesReader.cc.

References bookedEfficHistos, gather_cfg::cout, csc_type, CSC_TYPES, debug, hEfficALCTEta, hEfficALCTEtaCsc, hEfficCLCTEta, hEfficCLCTEtaCsc, hEfficHitsEta, hEfficHitsEtaCsc, mps_fire::i, LogTrace, TFileService::make(), MAX_STATIONS, FrontierCondition_GT_autoExpress_cfi::t0, RandomServiceHelper::t1, and RandomServiceHelper::t2.

Referenced by calcEfficiency().

1096  {
1098 
1099  // Efficiencies per station.
1100  char histname[60];
1101  for (int i = 0; i < MAX_STATIONS; i++) {
1102  sprintf(histname, "SimHits vs eta, station %d", i + 1);
1103  hEfficHitsEta[i] = fs->make<TH1F>("", histname, 66, 0.875, 2.525);
1104 
1105  sprintf(histname, "ALCTs vs eta, station %d", i + 1);
1106  hEfficALCTEta[i] = fs->make<TH1F>("", histname, 66, 0.875, 2.525);
1107 
1108  sprintf(histname, "CLCTs vs eta, station %d", i + 1);
1109  hEfficCLCTEta[i] = fs->make<TH1F>("", histname, 66, 0.875, 2.525);
1110  }
1111 
1112  // Efficiencies per chamber type.
1113  for (int i = 0; i < CSC_TYPES; i++) {
1114  string t0 = "SimHits vs eta, " + csc_type[i];
1115  hEfficHitsEtaCsc[i] = fs->make<TH1F>("", t0.c_str(), 66, 0.875, 2.525);
1116  string t1 = "ALCTs vs eta, " + csc_type[i];
1117  hEfficALCTEtaCsc[i] = fs->make<TH1F>("", t1.c_str(), 66, 0.875, 2.525);
1118  string t2 = "CLCTs vs eta, " + csc_type[i];
1119  hEfficCLCTEtaCsc[i] = fs->make<TH1F>("", t1.c_str(), 66, 0.875, 2.525);
1120  }
1121 
1122  bookedEfficHistos = true;
1123  if (debug)
1124  LogTrace("CSCTriggerPrimitivesReader") << "bookedEfficHistos ";
1125  std::cout << " bookedEfficHistos " << std::endl;
1126 }
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
static const std::string csc_type[CSC_TYPES]
#define LogTrace(id)
void CSCTriggerPrimitivesReader::bookHotWireHistos ( )
private

Definition at line 633 of file CSCTriggerPrimitivesReader.cc.

References bookedHotWireHistos, hHotCham1, hHotWire1, and TFileService::make().

Referenced by HotWires().

633  {
635  hHotWire1 = fs->make<TH1F>("hHotWire1", "hHotWire1", 570 * 6 * 112, 0, 570 * 6 * 112);
636  hHotCham1 = fs->make<TH1F>("hHotCham1", "hHotCham1", 570, 0, 570);
637  bookedHotWireHistos = true;
638 }
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
void CSCTriggerPrimitivesReader::bookLCTMPCHistos ( )
private

Definition at line 831 of file CSCTriggerPrimitivesReader.cc.

References bookedLCTMPCHistos, gather_cfg::cout, debug, hCorrLctMPCPerCSC, hLctMPCBend, hLctMPCBXN, hLctMPCChamber, hLctMPCEndcap, hLctMPCKeyGroup, hLctMPCKeyGroupME11, hLctMPCKeyStrip, hLctMPCKeyStripME11, hLctMPCPattern, hLctMPCPerCSC, hLctMPCPerEvent, hLctMPCQuality, hLctMPCRing, hLctMPCSector, hLctMPCStation, hLctMPCStripType, hLctMPCValid, LogTrace, TFileService::make(), and MAX_STATIONS.

Referenced by fillLCTMPCHistos().

831  {
833  hLctMPCPerEvent = fs->make<TH1F>("MPC_per_event", "LCTs per event", 31, -0.5, 30.5);
834  hLctMPCPerCSC = fs->make<TH1F>("MPC_per_CSCtype", "LCTs per CSC type", 10, -0.5, 9.5);
835  hCorrLctMPCPerCSC = fs->make<TH1F>("CorrMPC_per_CSCtype", "Corr. LCTs per CSC type", 10, -0.5, 9.5);
836  hLctMPCEndcap = fs->make<TH1F>("MPC_Endcap", "Endcap", 4, -0.5, 3.5);
837  hLctMPCStation = fs->make<TH1F>("MPC_Station", "Station", 6, -0.5, 5.5);
838  hLctMPCSector = fs->make<TH1F>("MPC_Sector", "Sector", 8, -0.5, 7.5);
839  hLctMPCRing = fs->make<TH1F>("MPC_Ring", "Ring", 5, -0.5, 4.5);
840 
841  hLctMPCValid = fs->make<TH1F>("MPC_validity", "LCT validity", 3, -0.5, 2.5);
842  hLctMPCQuality = fs->make<TH1F>("MPC_quality", "LCT quality", 17, -0.5, 16.5);
843  hLctMPCKeyGroup = fs->make<TH1F>("MPC_key_wiregroup", "LCT key wiregroup", 120, -0.5, 119.5);
844  hLctMPCKeyStrip = fs->make<TH1F>("MPC_key_strip", "LCT key strip", 160, -0.5, 159.5);
845  hLctMPCStripType = fs->make<TH1F>("MPC_strip_type", "LCT strip type", 3, -0.5, 2.5);
846  hLctMPCPattern = fs->make<TH1F>("MPC_pattern", "LCT pattern", 13, -0.5, 12.5);
847  hLctMPCBend = fs->make<TH1F>("MPC_bend", "LCT L/R bend", 3, -0.5, 2.5);
848  hLctMPCBXN = fs->make<TH1F>("MPC_bx", "LCT bx", 20, -0.5, 19.5);
849 
850  // LCT quantities per station
851  char histname[60];
852  for (int istat = 0; istat < MAX_STATIONS; istat++) {
853  sprintf(histname, "MPC_CSCId, station %d", istat + 1);
854  hLctMPCChamber[istat] = fs->make<TH1F>("", histname, 10, -0.5, 9.5);
855  }
856 
857  hLctMPCKeyGroupME11 = fs->make<TH1F>("hLctMPCKeyGroupME11", "MPC LCT key wiregroup ME1/1", 50, -0.5, 49.5);
858  hLctMPCKeyStripME11 = fs->make<TH1F>("hLctMPCKeyStripME11", "MPC LCT key strip ME1/1", 161, -0.5, 160.5);
859 
860  bookedLCTMPCHistos = true;
861  if (debug)
862  LogTrace("CSCTriggerPrimitivesReader") << "bookedLCTMPCHistos ";
863  std::cout << " bookedLCTMPCHistos " << std::endl;
864 }
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
#define LogTrace(id)
void CSCTriggerPrimitivesReader::bookLCTTMBHistos ( )
private

Definition at line 726 of file CSCTriggerPrimitivesReader.cc.

References bookedLCTTMBHistos, gather_cfg::cout, csc_type_minus, csc_type_plus, CSC_TYPES, hCorrLctTMBPerCSC, hLctTMBBend, hLctTMBBXN, hLctTMBChamber, hLctTMBCsc, hLctTMBEndcap, hLctTMBKeyGroup, hLctTMBKeyGroupME11, hLctTMBKeyStrip, hLctTMBKeyStripME11, hLctTMBPattern, hLctTMBPerChamber, hLctTMBPerCSC, hLctTMBPerEvent, hLctTMBQuality, hLctTMBRing, hLctTMBSector, hLctTMBStation, hLctTMBStripType, hLctTMBValid, mps_fire::i, dqmiolumiharvest::j, TFileService::make(), MAX_ENDCAPS, MAX_STATIONS, NCHAMBERS, and alignCSCRings::s.

Referenced by fillLCTTMBHistos().

726  {
727  string s;
728 
730  hLctTMBPerEvent = fs->make<TH1F>("LCTs_per_event", "LCTs per event", 31, -0.5, 30.5);
731  hLctTMBPerChamber = fs->make<TH1F>("LCTs_per_chamber", "LCTs per chamber", 3, -0.5, 2.5);
732  hLctTMBPerCSC = fs->make<TH1F>("LCTs_per_CSCtype", "LCTs per CSC type", 10, -0.5, 9.5);
733  hCorrLctTMBPerCSC = fs->make<TH1F>("CorrLCTs_per_CSCtype", "Corr. LCTs per CSC type", 10, -0.5, 9.5);
734  hLctTMBEndcap = fs->make<TH1F>("LCTS_endcap", "Endcap", 4, -0.5, 3.5);
735  hLctTMBStation = fs->make<TH1F>("LCTS_station", "Station", 6, -0.5, 5.5);
736  hLctTMBSector = fs->make<TH1F>("LCTS_sector", "Sector", 8, -0.5, 7.5);
737  hLctTMBRing = fs->make<TH1F>("LCTS_ring", "Ring", 5, -0.5, 4.5);
738  for (int i = 0; i < MAX_ENDCAPS; i++) { // endcaps
739  for (int j = 0; j < CSC_TYPES; j++) { // station/ring
740  char asdf[256];
741  float csc_max = NCHAMBERS[j] + 0.5;
742  if (i == 0)
743  s = "LCTs, " + csc_type_plus[j];
744  else
745  s = "LCTs, " + csc_type_minus[j];
746  sprintf(asdf, "LCTs_%i", i * CSC_TYPES + j);
747  hLctTMBCsc[i][j] = fs->make<TH1F>(s.c_str(), s.c_str(), NCHAMBERS[j], 0.5, csc_max);
748  }
749  }
750 
751  hLctTMBValid = fs->make<TH1F>("LCT_validity", "LCT validity", 3, -0.5, 2.5);
752  hLctTMBQuality = fs->make<TH1F>("LCT_quality", "LCT quality", 17, -0.5, 16.5);
753  hLctTMBKeyGroup = fs->make<TH1F>("LCT_key_wiregroup", "LCT key wiregroup", 120, -0.5, 119.5);
754  hLctTMBKeyStrip = fs->make<TH1F>("LCT_key_strip", "LCT key strip", 160, -0.5, 159.5);
755  hLctTMBStripType = fs->make<TH1F>("LCT_strip_type", "LCT strip type", 3, -0.5, 2.5);
756  hLctTMBPattern = fs->make<TH1F>("LCT_pattern", "LCT pattern", 13, -0.5, 12.5);
757  hLctTMBBend = fs->make<TH1F>("LCT_bend", "LCT L/R bend", 3, -0.5, 2.5);
758  hLctTMBBXN = fs->make<TH1F>("LCT_bx", "LCT bx", 20, -0.5, 19.5);
759 
760  // LCT quantities per station
761  char histname[60];
762  for (int istat = 0; istat < MAX_STATIONS; istat++) {
763  sprintf(histname, "LCT_CSCId, station %d", istat + 1);
764  hLctTMBChamber[istat] = fs->make<TH1F>("", histname, 10, -0.5, 9.5);
765  }
766 
767  hLctTMBKeyGroupME11 = fs->make<TH1F>("hLctTMBKeyGroupME11", "LCT key wiregroup ME1/1", 50, -0.5, 49.5);
768  hLctTMBKeyStripME11 = fs->make<TH1F>("hLctTMBKeyStripME11", "LCT key strip ME1/1", 161, -0.5, 160.5);
769 
770  bookedLCTTMBHistos = true;
771  std::cout << " bookedLCTTMBHistos " << std::endl;
772 }
static const int NCHAMBERS[CSC_TYPES]
static const std::string csc_type_minus[CSC_TYPES]
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
TH1F * hLctTMBCsc[MAX_ENDCAPS][CSC_TYPES]
static const std::string csc_type_plus[CSC_TYPES]
void CSCTriggerPrimitivesReader::bookResolHistos ( )
private

Definition at line 1015 of file CSCTriggerPrimitivesReader.cc.

References bookedResolHistos, csc_type, CSC_TYPES, debug, hAlctVsEta, hClctVsPhi, hEtaDiffCsc, hEtaDiffVsEta, hEtaDiffVsWireCsc, hEtaRecVsSim, hPhiDiffCsc, hPhiDiffPattern, hPhiDiffVsPhi, hPhiDiffVsStripCsc, hPhiRecVsSim, hResolDeltaDS, hResolDeltaEta, hResolDeltaHS, hResolDeltaPhi, hResolDeltaPhiDS, hResolDeltaPhiHS, hResolDeltaWG, hTrueBendCsc, mps_fire::i, LogTrace, TFileService::make(), MAX_HS, MAX_STATIONS, MAX_WG, CSCConstants::NUM_CLCT_PATTERNS, ptype_TMB07, FrontierCondition_GT_autoExpress_cfi::t0, RandomServiceHelper::t1, RandomServiceHelper::t2, TWOPI, testProducerWithPsetDescEmpty_cfi::u1, and MetAnalyzer::u2.

Referenced by calcResolution().

1015  {
1017 
1018  // Limits for resolution histograms
1019  const double EDMIN = -0.05; // eta min
1020  const double EDMAX = 0.05; // eta max
1021  const double PDMIN = -5.0; // phi min (mrad)
1022  const double PDMAX = 5.0; // phi max (mrad)
1023 
1024  hResolDeltaWG = fs->make<TH1F>("", "Delta key wiregroup", 10, -5., 5.);
1025 
1026  hResolDeltaHS = fs->make<TH1F>("", "Delta key halfstrip", 10, -5., 5.);
1027  hResolDeltaDS = fs->make<TH1F>("", "Delta key distrip", 10, -5., 5.);
1028 
1029  hResolDeltaEta = fs->make<TH1F>("", "#eta_rec-#eta_sim", 100, EDMIN, EDMAX);
1030  hResolDeltaPhi = fs->make<TH1F>("", "#phi_rec-#phi_sim (mrad)", 100, -10., 10.);
1031  hResolDeltaPhiHS = fs->make<TH1F>("", "#phi_rec-#phi_sim (mrad), halfstrips", 100, -10., 10.);
1032  hResolDeltaPhiDS = fs->make<TH1F>("", "#phi_rec-#phi_sim (mrad), distrips", 100, -10., 10.);
1033 
1034  hEtaRecVsSim = fs->make<TH2F>("", "#eta_rec vs #eta_sim", 64, 0.9, 2.5, 64, 0.9, 2.5);
1035  hPhiRecVsSim = fs->make<TH2F>("", "#phi_rec vs #phi_sim", 100, 0., TWOPI, 100, 0., TWOPI);
1036 
1037  // LCT quantities per station
1038  char histname[60];
1039  for (int i = 0; i < MAX_STATIONS; i++) {
1040  sprintf(histname, "ALCTs vs eta, station %d", i + 1);
1041  hAlctVsEta[i] = fs->make<TH1F>("", histname, 66, 0.875, 2.525);
1042 
1043  sprintf(histname, "CLCTs vs phi, station %d", i + 1);
1044  hClctVsPhi[i] = fs->make<TH1F>("", histname, 100, 0., TWOPI);
1045 
1046  sprintf(histname, "#LT#eta_rec-#eta_sim#GT, station %d", i + 1);
1047  hEtaDiffVsEta[i] = fs->make<TH1F>("", histname, 66, 0.875, 2.525);
1048 
1049  sprintf(histname, "#LT#phi_rec-#phi_sim#GT, station %d", i + 1);
1050  hPhiDiffVsPhi[i] = fs->make<TH1F>("", histname, 100, 0., TWOPI);
1051  }
1052 
1053  for (int i = 0; i < CSC_TYPES; i++) {
1054  string t0 = "#eta_rec-#eta_sim, " + csc_type[i];
1055  hEtaDiffCsc[i][0] = fs->make<TH1F>("", t0.c_str(), 100, EDMIN, EDMAX);
1056  string t1 = t0 + ", endcap1";
1057  hEtaDiffCsc[i][1] = fs->make<TH1F>("", t1.c_str(), 100, EDMIN, EDMAX);
1058  string t2 = t0 + ", endcap2";
1059  hEtaDiffCsc[i][2] = fs->make<TH1F>("", t2.c_str(), 100, EDMIN, EDMAX);
1060 
1061  string t4 = "#eta_rec-#eta_sim vs wiregroup, " + csc_type[i];
1062  hEtaDiffVsWireCsc[i] = fs->make<TH2F>("", t4.c_str(), MAX_WG[i], 0., MAX_WG[i], 100, EDMIN, EDMAX);
1063 
1064  string u0 = "#phi_rec-#phi_sim, " + csc_type[i];
1065  hPhiDiffCsc[i][0] = fs->make<TH1F>("", u0.c_str(), 100, PDMIN, PDMAX);
1066  string u1 = u0 + ", endcap1";
1067  hPhiDiffCsc[i][1] = fs->make<TH1F>("", u1.c_str(), 100, PDMIN, PDMAX);
1068  string u2 = u0 + ", endcap2";
1069  hPhiDiffCsc[i][2] = fs->make<TH1F>("", u2.c_str(), 100, PDMIN, PDMAX);
1070  hPhiDiffCsc[i][3] = fs->make<TH1F>("", u0.c_str(), 100, PDMIN, PDMAX);
1071  hPhiDiffCsc[i][4] = fs->make<TH1F>("", u0.c_str(), 100, PDMIN, PDMAX);
1072 
1073  int MAX_DS = MAX_HS[i] / 4;
1074  string u5 = "#phi_rec-#phi_sim (mrad) vs distrip, " + csc_type[i];
1075  hPhiDiffVsStripCsc[i][0] = fs->make<TH2F>("", u5.c_str(), MAX_DS, 0., MAX_DS, 100, PDMIN, PDMAX);
1076  string u6 = "#phi_rec-#phi_sim (mrad) vs halfstrip, " + csc_type[i];
1077  hPhiDiffVsStripCsc[i][1] = fs->make<TH2F>("", u6.c_str(), MAX_HS[i], 0., MAX_HS[i], 100, PDMIN, PDMAX);
1078 
1079  string u7 = "#phi(layer 1)-#phi(layer 6), mrad, " + csc_type[i];
1080  hTrueBendCsc[i] = fs->make<TH1F>("", u7.c_str(), 100, -10., 10.);
1081  }
1082 
1083  int max_patterns, phibend;
1084  max_patterns = CSCConstants::NUM_CLCT_PATTERNS;
1085  for (int i = 0; i < max_patterns; i++) {
1086  phibend = ptype_TMB07[i];
1087  sprintf(histname, "#phi_rec-#phi_sim, bend = %d", phibend);
1088  hPhiDiffPattern[i] = fs->make<TH1F>("", histname, 100, PDMIN, PDMAX);
1089  }
1090 
1091  bookedResolHistos = true;
1092  if (debug)
1093  LogTrace("CSCTriggerPrimitivesReader") << "bookedResolHistos ";
1094 }
static const int MAX_HS[CSC_TYPES]
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
static const std::string csc_type[CSC_TYPES]
#define LogTrace(id)
TH1F * hPhiDiffPattern[CSCConstants::NUM_CLCT_PATTERNS]
static const int ptype_TMB07[CSCConstants::NUM_CLCT_PATTERNS]
static const int MAX_WG[CSC_TYPES]
void CSCTriggerPrimitivesReader::calcEfficiency ( const CSCALCTDigiCollection alcts,
const CSCCLCTDigiCollection clcts,
const edm::PSimHitContainer allSimHits 
)
private

Definition at line 2906 of file CSCTriggerPrimitivesReader.cc.

References funct::abs(), badChambers_, bookedEfficHistos, bookEfficHistos(), relativeConstraints::chamber, CSCDetId::chamber(), checkBadChambers_, CSCDetId::endcap(), makeMuonMisalignmentScenario::endcap, PV3DBase< T, PVType, FrameType >::eta(), geom_, getCSCType(), hEfficALCTEta, hEfficALCTEtaCsc, hEfficCLCTEta, hEfficCLCTEtaCsc, hEfficHitsEta, hEfficHitsEtaCsc, CSCBadChambers::isInBadChamber(), CSCDetId::layer(), CSCGeometry::layer(), LogTrace, ticl::constants::nLayers, CSCConstants::NUM_LAYERS, plotME1A, FastTimerService_cff::range, CSCDetId::ring(), relativeConstraints::ring, relativeConstraints::station, CSCDetId::station(), and GeomDet::toGlobal().

Referenced by MCStudies().

2908  {
2909  // Book histos when called for the first time.
2910  if (!bookedEfficHistos)
2911  bookEfficHistos();
2912 
2913  // Create list of chambers having SimHits.
2914  vector<CSCDetId> chamberIds;
2915  vector<CSCDetId>::const_iterator chamberIdIt;
2916  for (const auto& simHitIt : allSimHits) {
2917  // Find detId where simHit is located.
2918  bool sameId = false;
2919  CSCDetId hitId = (CSCDetId)simHitIt.detUnitId();
2920  // Skip chambers marked as bad (includes most of ME4/2 chambers).
2922  continue;
2923  //if (hitId.ring() == 4) continue; // skip ME1/A for now.
2924  if (!plotME1A && hitId.ring() == 4)
2925  continue;
2926  for (const auto& chamberId : chamberIds) {
2927  if (chamberId.endcap() == hitId.endcap() && chamberId.station() == hitId.station() &&
2928  chamberId.ring() == hitId.ring() && chamberId.chamber() == hitId.chamber()) {
2929  sameId = true;
2930  break;
2931  }
2932  }
2933  if (!sameId) {
2934  CSCDetId newChamberId(hitId.endcap(), hitId.station(), hitId.ring(), hitId.chamber(), 0);
2935  chamberIds.push_back(newChamberId);
2936  }
2937  }
2938  LogTrace("CSCTriggerPrimitivesReader") << "Found SimHits in " << chamberIds.size() << " CSCs";
2939 
2940  bool used[CSCConstants::NUM_LAYERS];
2941  vector<PSimHit> simHitsV[CSCConstants::NUM_LAYERS];
2942  for (const auto& chamberId : chamberIds) {
2943  // Find out how many layers of this chamber have SimHits.
2944  int nLayers = 0;
2945  for (int ilayer = 0; ilayer < CSCConstants::NUM_LAYERS; ilayer++) {
2946  used[ilayer] = false;
2947  simHitsV[ilayer].clear();
2948  }
2949 
2950  int endcap = chamberId.endcap();
2951  int station = chamberId.station();
2952  int ring = chamberId.ring();
2953  int chamber = chamberId.chamber();
2954  for (const auto& simHitIt : allSimHits) {
2955  CSCDetId hitId = (CSCDetId)simHitIt.detUnitId();
2956  if (hitId.endcap() == endcap && hitId.station() == station && hitId.ring() == ring &&
2957  hitId.chamber() == chamber) {
2958  int layer = hitId.layer() - 1;
2959  if (!used[layer] && abs(simHitIt.particleType()) == 13) {
2960  nLayers++;
2961  used[layer] = true;
2962  simHitsV[layer].push_back(simHitIt);
2963  }
2964  }
2965  }
2966  LogTrace("CSCTriggerPrimitivesReader") << "CSC in ME" << ((endcap == 1) ? "+" : "-") << station << "/" << ring
2967  << "/" << chamber << " has muon hits in " << nLayers << " layers";
2968 
2969  // If the number of layers with hits is above threshold, look for
2970  // a presence of LCTs.
2971  if (nLayers > 3) { // Should be a parameter.
2972  // Start with the key layer and take the eta of the first hit.
2973  // Really crude; should be improved.
2974  double hitEta = -999.;
2975  for (int ilayer = 2; ilayer < CSCConstants::NUM_LAYERS; ilayer++) {
2976  vector<PSimHit> layerSimHitsV = simHitsV[ilayer];
2977  if (!layerSimHitsV.empty()) {
2978  LocalPoint hitLP = layerSimHitsV[0].localPosition();
2979  CSCDetId layerId = (CSCDetId)(layerSimHitsV[0]).detUnitId();
2980  const CSCLayer* csclayer = geom_->layer(layerId);
2981  GlobalPoint hitGP = csclayer->toGlobal(hitLP);
2982  hitEta = hitGP.eta();
2983  break;
2984  }
2985  }
2986  if (hitEta < -3.) {
2987  edm::LogWarning("L1CSCTPEmulatorWrongValues") << "+++ Warning in calcEfficiency(): no SimHit found"
2988  << " where there must be at least " << nLayers << "! +++\n";
2989  continue;
2990  }
2991  int csctype = getCSCType(*chamberIdIt);
2992  hEfficHitsEta[station - 1]->Fill(fabs(hitEta));
2993  hEfficHitsEtaCsc[csctype]->Fill(fabs(hitEta));
2994 
2995  bool isALCT = false;
2996  for (auto adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) {
2997  const CSCDetId& id = (*adetUnitIt).first;
2998  if (id == (*chamberIdIt)) {
2999  const auto& range = (*adetUnitIt).second;
3000  for (auto digiIt = range.first; digiIt != range.second; digiIt++) {
3001  if (digiIt->isValid()) {
3002  // Check the distance??
3003  LogTrace("CSCTriggerPrimitivesReader") << "ALCT was found";
3004  isALCT = true;
3005  break;
3006  }
3007  }
3008  }
3009  if (isALCT)
3010  break;
3011  }
3012  if (isALCT) {
3013  hEfficALCTEta[station - 1]->Fill(fabs(hitEta));
3014  hEfficALCTEtaCsc[csctype]->Fill(fabs(hitEta));
3015  } else {
3016  LogTrace("CSCTriggerPrimitivesReader") << "ALCT was not found";
3017  }
3018 
3019  bool isCLCT = false;
3020  for (auto cdetUnitIt = clcts->begin(); cdetUnitIt != clcts->end(); cdetUnitIt++) {
3021  const CSCDetId& id = (*cdetUnitIt).first;
3022  if (id == (*chamberIdIt)) {
3023  const auto& range = (*cdetUnitIt).second;
3024  for (auto digiIt = range.first; digiIt != range.second; digiIt++) {
3025  if (digiIt->isValid()) {
3026  // Check the distance??
3027  LogTrace("CSCTriggerPrimitivesReader") << "CLCT was found";
3028  isCLCT = true;
3029  break;
3030  }
3031  }
3032  }
3033  if (isCLCT)
3034  break;
3035  }
3036  if (isCLCT) {
3037  hEfficCLCTEta[station - 1]->Fill(fabs(hitEta));
3038  hEfficCLCTEtaCsc[csctype]->Fill(fabs(hitEta));
3039  } else {
3040  LogTrace("CSCTriggerPrimitivesReader") << "CLCT was not found";
3041  }
3042  }
3043  }
3044 }
int chamber() const
Definition: CSCDetId.h:62
constexpr int nLayers
Definition: Common.h:13
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
int layer() const
Definition: CSCDetId.h:56
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
int endcap() const
Definition: CSCDetId.h:85
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define LogTrace(id)
int ring() const
Definition: CSCDetId.h:68
T eta() const
Definition: PV3DBase.h:73
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:105
int station() const
Definition: CSCDetId.h:79
void CSCTriggerPrimitivesReader::calcResolution ( const CSCALCTDigiCollection alcts,
const CSCCLCTDigiCollection clcts,
const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const edm::PSimHitContainer allSimHits 
)
private

Definition at line 2715 of file CSCTriggerPrimitivesReader.cc.

References funct::abs(), badChambers_, bookedResolHistos, bookResolHistos(), relativeConstraints::chamber, checkBadChambers_, debug, spr::deltaEta, SiPixelRawToDigiRegional_cfi::deltaPhi, makeMuonMisalignmentScenario::endcap, geom_, getCSCType(), getHsPerRad(), CSCAnodeLCTAnalyzer::getSimInfo(), CSCCathodeLCTAnalyzer::getSimInfo(), CSCCathodeLCTAnalyzer::getStripPhi(), CSCAnodeLCTAnalyzer::getWGEta(), hAlctVsEta, hClctVsPhi, hEtaDiffCsc, hEtaDiffVsEta, hEtaDiffVsWireCsc, hEtaRecVsSim, hPhiDiffCsc, hPhiDiffPattern, hPhiDiffVsPhi, hPhiDiffVsStripCsc, hPhiRecVsSim, hResolDeltaDS, hResolDeltaEta, hResolDeltaHS, hResolDeltaPhi, hResolDeltaPhiDS, hResolDeltaPhiHS, hResolDeltaWG, hTrueBendCsc, CSCBadChambers::isInBadChamber(), CSCConstants::KEY_ALCT_LAYER, CSCConstants::KEY_CLCT_LAYER, CSCDetId::layer(), CSCGeometry::layer(), LogTrace, M_PI, CSCCathodeLCTAnalyzer::nearestHS(), CSCAnodeLCTAnalyzer::nearestWG(), phi, FastTimerService_cff::range, relativeConstraints::ring, CSCAnodeLCTAnalyzer::setGeometry(), CSCCathodeLCTAnalyzer::setGeometry(), relativeConstraints::station, digitizers_cfi::strip, and GeomDet::toGlobal().

Referenced by MCStudies().

2719  {
2720  // Book histos when called for the first time.
2721  if (!bookedResolHistos)
2722  bookResolHistos();
2723 
2724  // ALCT resolution
2725  CSCAnodeLCTAnalyzer alct_analyzer;
2726  alct_analyzer.setGeometry(geom_);
2727 
2728  for (auto adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) {
2729  const CSCDetId& id = (*adetUnitIt).first;
2731  continue;
2732  const auto& range = (*adetUnitIt).second;
2733  for (auto digiIt = range.first; digiIt != range.second; digiIt++) {
2734  bool alct_valid = (*digiIt).isValid();
2735  if (alct_valid) {
2736  vector<CSCAnodeLayerInfo> alctInfo = alct_analyzer.getSimInfo(*digiIt, id, wiredc, &allSimHits);
2737 
2738  double hitPhi = -999.0, hitEta = -999.0;
2739  int hitWG = alct_analyzer.nearestWG(alctInfo, hitPhi, hitEta);
2740  if (hitWG >= 0.) {
2741  // Key wire group and key layer id.
2742  int wiregroup = (*digiIt).getKeyWG();
2743 
2744  CSCDetId layerId(id.endcap(), id.station(), id.ring(), id.chamber(), CSCConstants::KEY_ALCT_LAYER);
2745  int endc = id.endcap();
2746  int stat = id.station();
2747  int csctype = getCSCType(id);
2748 
2749  double alctEta = alct_analyzer.getWGEta(layerId, wiregroup);
2750  double deltaEta = alctEta - hitEta;
2751  hResolDeltaEta->Fill(deltaEta);
2752 
2753  double deltaWG = wiregroup - hitWG;
2754  if (debug)
2755  LogTrace("CSCTriggerPrimitivesReader")
2756  << "WG: MC = " << hitWG << " rec = " << wiregroup << " delta = " << deltaWG;
2757  hResolDeltaWG->Fill(deltaWG);
2758 
2759  hEtaRecVsSim->Fill(fabs(hitEta), fabs(alctEta));
2760  hEtaDiffCsc[csctype][0]->Fill(deltaEta);
2761  hEtaDiffCsc[csctype][endc]->Fill(deltaEta);
2762  hAlctVsEta[stat - 1]->Fill(fabs(alctEta));
2763  hEtaDiffVsEta[stat - 1]->Fill(fabs(alctEta), fabs(deltaEta));
2764  hEtaDiffVsWireCsc[csctype]->Fill(wiregroup, deltaEta);
2765  }
2766  // should I comment out this "else"?
2767  //else {
2768  // edm::LogWarning("L1CSCTPEmulatorWrongInput")
2769  // << "+++ Warning in calcResolution(): no matched SimHit"
2770  // << " found! +++\n";
2771  //}
2772  }
2773  }
2774  }
2775 
2776  // CLCT resolution
2777  static const int key_layer = CSCConstants::KEY_CLCT_LAYER;
2778  CSCCathodeLCTAnalyzer clct_analyzer;
2779  clct_analyzer.setGeometry(geom_);
2780 
2781  for (auto cdetUnitIt = clcts->begin(); cdetUnitIt != clcts->end(); cdetUnitIt++) {
2782  const CSCDetId& id = (*cdetUnitIt).first;
2784  continue;
2785  const auto& range = (*cdetUnitIt).second;
2786  for (auto digiIt = range.first; digiIt != range.second; digiIt++) {
2787  bool clct_valid = (*digiIt).isValid();
2788  if (clct_valid) {
2789  vector<CSCCathodeLayerInfo> clctInfo = clct_analyzer.getSimInfo(*digiIt, id, compdc, &allSimHits);
2790 
2791  double hitPhi = -999.0, hitEta = -999.0, deltaStrip = -999.0;
2792  int hitHS = clct_analyzer.nearestHS(clctInfo, hitPhi, hitEta);
2793  if (hitHS >= 0.) {
2794  // Key strip and key layer id.
2795  int halfstrip = (*digiIt).getKeyStrip();
2796  int strip = halfstrip / 2;
2797  int distrip = halfstrip / 4;
2798  int stripType = (*digiIt).getStripType();
2799 
2800  CSCDetId layerId(id.endcap(), id.station(), id.ring(), id.chamber(), key_layer);
2801  int endc = id.endcap();
2802  int stat = id.station();
2803  int csctype = getCSCType(id);
2804 
2805  // 'float strip' is in the units of 'strip', i.e., angular
2806  // widths of each strip. The counting is from 0.0 at the extreme
2807  // edge of the 'first' strip at one edge of the detector.
2808  float fstrip = -999.;
2809  if (stripType == 0) { // di-strip CLCT
2810  fstrip = strip + 1.;
2811  } else { // half-strip CLCT
2812  fstrip = strip + 0.5 * (halfstrip % 2) + 0.25;
2813  }
2814  double clctPhi = clct_analyzer.getStripPhi(layerId, fstrip);
2815  double deltaPhi = clctPhi - hitPhi;
2816  if (deltaPhi < -M_PI)
2817  deltaPhi += 2. * M_PI;
2818  else if (deltaPhi > M_PI)
2819  deltaPhi -= 2. * M_PI;
2820  deltaPhi *= 1000; // in mrad
2821  if (hitPhi < 0)
2822  hitPhi += 2. * M_PI;
2823  if (clctPhi < 0)
2824  clctPhi += 2. * M_PI;
2825  if (debug)
2826  LogTrace("CSCTriggerPrimitivesReader")
2827  << " clctPhi = " << clctPhi << " hitPhi = " << hitPhi << " deltaPhi = " << deltaPhi;
2828 
2829  hResolDeltaPhi->Fill(deltaPhi);
2830  if (stripType == 0) { // di-strip CLCT
2831  deltaStrip = distrip - hitHS / 4;
2832  hResolDeltaDS->Fill(deltaStrip);
2833  hResolDeltaPhiDS->Fill(deltaPhi);
2834  hPhiDiffVsStripCsc[csctype][0]->Fill(distrip, deltaPhi);
2835  } else { // half-strip CLCT
2836  deltaStrip = halfstrip - hitHS;
2837  hResolDeltaHS->Fill(deltaStrip);
2838  hResolDeltaPhiHS->Fill(deltaPhi);
2839  hPhiDiffVsStripCsc[csctype][1]->Fill(halfstrip, deltaPhi);
2840  }
2841  if (debug)
2842  LogTrace("CSCTriggerPrimitivesReader") << "Half-strip: MC = " << hitHS << " rec = " << halfstrip
2843  << " pattern type = " << stripType << " delta = " << deltaStrip;
2844 
2845  hPhiRecVsSim->Fill(hitPhi, clctPhi);
2846  hPhiDiffCsc[csctype][0]->Fill(deltaPhi);
2847  hPhiDiffCsc[csctype][endc]->Fill(deltaPhi);
2848  hPhiDiffCsc[csctype][stripType + 3]->Fill(deltaPhi);
2849  hClctVsPhi[stat - 1]->Fill(clctPhi);
2850  hPhiDiffVsPhi[stat - 1]->Fill(clctPhi, fabs(deltaPhi));
2851 
2852  // Histograms to check phi offsets for various pattern types
2853  if (stripType == 1) { // half-strips
2854  double hsperrad = getHsPerRad(csctype); // halfstrips-per-radian
2855  if ((endc == 1 && (stat == 1 || stat == 2)) || (endc == 2 && (stat == 3 || stat == 4))) {
2856  hPhiDiffPattern[(*digiIt).getPattern()]->Fill(deltaPhi / 1000 * hsperrad);
2857  }
2858  }
2859  }
2860  // should I comment out this "else"?
2861  //else {
2862  // edm::LogWarning("L1CSCTPEmulatorWrongInput")
2863  // << "+++ Warning in calcResolution(): no matched SimHit"
2864  // << " found! +++\n";
2865  //}
2866 
2867  // "True bend", defined as difference in phi between muon hit
2868  // positions in the first and in the sixth layers.
2869  double phi1 = -999.0, phi6 = -999.0;
2870  vector<CSCCathodeLayerInfo>::const_iterator pli;
2871  for (pli = clctInfo.begin(); pli != clctInfo.end(); pli++) {
2872  CSCDetId layerId = pli->getId();
2873  int layer = layerId.layer();
2874  if (layer == 1 || layer == 6) {
2875  // Get simHits in this layer.
2876  for (const auto& psh : allSimHits) {
2877  // Find detId where simHit is located.
2878  CSCDetId hitId = (CSCDetId)psh.detUnitId();
2879  if (hitId == layerId && abs(psh.particleType()) == 13) { // muon hits only
2880  const CSCLayer* csclayer = geom_->layer(layerId);
2881  const auto& thisPoint = csclayer->toGlobal(psh.localPosition());
2882  double phi = thisPoint.phi();
2883  if (layer == 1)
2884  phi1 = phi;
2885  else if (layer == 6)
2886  phi6 = phi;
2887  break; // simply take the first suitable hit.
2888  }
2889  }
2890  }
2891  }
2892  if (phi1 > -99. && phi6 > -99.) {
2893  double deltaPhi = phi1 - phi6;
2894  if (deltaPhi > M_PI)
2895  deltaPhi -= 2. * M_PI;
2896  else if (deltaPhi < -M_PI)
2897  deltaPhi += 2. * M_PI;
2898  int csctype = getCSCType(id);
2899  hTrueBendCsc[csctype]->Fill(deltaPhi * 1000.); // in mrad
2900  }
2901  }
2902  }
2903  }
2904 }
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
int nearestWG(const std::vector< CSCAnodeLayerInfo > &allLayerInfo, double &closestPhi, double &closestEta)
int layer() const
Definition: CSCDetId.h:56
void setGeometry(const CSCGeometry *geom)
std::vector< CSCAnodeLayerInfo > getSimInfo(const CSCALCTDigi &alct, const CSCDetId &alctId, const CSCWireDigiCollection *wiredc, const edm::PSimHitContainer *allSimHits)
static const double deltaEta
Definition: CaloConstants.h:8
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int nearestHS(const std::vector< CSCCathodeLayerInfo > &allLayerInfo, double &closestPhi, double &closestEta)
#define LogTrace(id)
double getWGEta(const CSCDetId &layerId, const int wiregroup)
#define M_PI
TH1F * hPhiDiffPattern[CSCConstants::NUM_CLCT_PATTERNS]
void setGeometry(const CSCGeometry *geom)
double getStripPhi(const CSCDetId &layerId, const float strip)
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:105
std::vector< CSCCathodeLayerInfo > getSimInfo(const CSCCLCTDigi &clct, const CSCDetId &clctId, const CSCComparatorDigiCollection *compdc, const edm::PSimHitContainer *allSimHits)
int CSCTriggerPrimitivesReader::chamberIX ( CSCDetId  id)

Definition at line 788 of file CSCTriggerPrimitivesReader.cc.

References makeMuonMisalignmentScenario::endcap, and relativeConstraints::station.

Referenced by compareALCTs(), compareCLCTs(), and compareLCTs().

788  {
789  int ix = 1;
790  if (id.station() != 1) {
791  ix = (id.station() - 2) * 2 + 3 + 1;
792  }
793  ix += id.ring() - 1;
794  if (id.endcap() == 2) {
795  ix *= -1;
796  }
797  return ix;
798 }
int CSCTriggerPrimitivesReader::chamberIXi ( CSCDetId  id)

Definition at line 774 of file CSCTriggerPrimitivesReader.cc.

References makeMuonMisalignmentScenario::endcap, and relativeConstraints::station.

Referenced by compareALCTs(), compareCLCTs(), and compareLCTs().

774  {
775  // 1/1 1/2 1/3 2/1 2/2 3/1 3/2 4/1 4/2 -1/1 -1/2 -1/3 -2/1 -2/2 -3/1 -3/2 -4/1 -4/2
776  //ix= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
777  int ix = 0;
778  if (id.station() != 1) {
779  ix = (id.station() - 2) * 2 + 3;
780  }
781  ix += id.ring() - 1;
782  if (id.endcap() == 2) {
783  ix += 9;
784  }
785  return ix;
786 }
int CSCTriggerPrimitivesReader::chamberSerial ( CSCDetId  id)

Definition at line 800 of file CSCTriggerPrimitivesReader.cc.

References RecoEcal_EventContent_cff::ec.

Referenced by compareALCTs(), and HotWires().

800  {
801  int st = id.station();
802  int ri = id.ring();
803  int ch = id.chamber();
804  int ec = id.endcap();
805  int kSerial = ch;
806  if (st == 1 && ri == 1)
807  kSerial = ch;
808  if (st == 1 && ri == 2)
809  kSerial = ch + 36;
810  if (st == 1 && ri == 3)
811  kSerial = ch + 72;
812  if (st == 1 && ri == 4)
813  kSerial = ch;
814  if (st == 2 && ri == 1)
815  kSerial = ch + 108;
816  if (st == 2 && ri == 2)
817  kSerial = ch + 126;
818  if (st == 3 && ri == 1)
819  kSerial = ch + 162;
820  if (st == 3 && ri == 2)
821  kSerial = ch + 180;
822  if (st == 4 && ri == 1)
823  kSerial = ch + 216;
824  if (st == 4 && ri == 2)
825  kSerial = ch + 234; // one day...
826  if (ec == 2)
827  kSerial = kSerial + 300;
828  return kSerial;
829 }
void CSCTriggerPrimitivesReader::compare ( const CSCALCTDigiCollection alcts_data,
const CSCALCTDigiCollection alcts_emul,
const CSCCLCTDigiCollection clcts_data,
const CSCCLCTDigiCollection clcts_emul,
const CSCCLCTPreTriggerDigiCollection pretrigs_emul,
const CSCCorrelatedLCTDigiCollection lcts_data,
const CSCCorrelatedLCTDigiCollection lcts_emul 
)
private

Definition at line 1376 of file CSCTriggerPrimitivesReader.cc.

References bookCompHistos(), bookedCompHistos, compareALCTs(), compareCLCTs(), and compareLCTs().

Referenced by analyze().

1382  {
1383  // Book histos when called for the first time.
1384  if (!bookedCompHistos)
1385  bookCompHistos();
1386 
1387  // Comparisons
1388  compareALCTs(alcts_data, alcts_emul);
1389  compareCLCTs(clcts_data, clcts_emul, pretrigs_emul);
1390  compareLCTs(lcts_data, lcts_emul, alcts_data, clcts_data);
1391  //compareMPCLCTs(mpclcts_data, mpclcts_emul, alcts_data, clcts_data);
1392 }
void compareLCTs(const CSCCorrelatedLCTDigiCollection *lcts_data, const CSCCorrelatedLCTDigiCollection *lcts_emul, const CSCALCTDigiCollection *alcts_data, const CSCCLCTDigiCollection *clcts_data)
void compareCLCTs(const CSCCLCTDigiCollection *clcts_data, const CSCCLCTDigiCollection *clcts_emul, const CSCCLCTPreTriggerDigiCollection *pretrigs_emul)
void compareALCTs(const CSCALCTDigiCollection *alcts_data, const CSCALCTDigiCollection *alcts_emul)
void CSCTriggerPrimitivesReader::compareALCTs ( const CSCALCTDigiCollection alcts_data,
const CSCALCTDigiCollection alcts_emul 
)
private

Definition at line 1394 of file CSCTriggerPrimitivesReader.cc.

References funct::abs(), badChambers_, MyStubComparison::bx_corr_emul, MyStubComparison::bx_data, MyStubComparison::bx_emul, relativeConstraints::cham, CSCDetId::chamber(), MyStubComparison::chamber, chamberIX(), chamberIXi(), chamberSerial(), MyStubComparison::chambertype, checkBadChambers_, dataIsAnotherMC_, debug, MyStubComparison::endcap, CSCDetId::endcap(), PV3DBase< T, PVType, FrameType >::eta(), MyStubComparison::eta_data, MyStubComparison::eta_emul, Event_, event_tree, eventsAnalyzed, MyStubComparison::firstfill, MyStubComparison::fullbx_data, MyStubComparison::fullbx_emul, getCSCType(), getGlobalPosition(), hAlctCompFound, hAlctCompFound2, hAlctCompFound2i, hAlctCompFound2x, hAlctCompFoundCsc, hAlctCompMatch, hAlctCompMatch2, hAlctCompMatch2i, hAlctCompMatch2x, hAlctCompMatchCsc, hAlctCompSameN2, hAlctCompSameN2i, hAlctCompSameN2x, hAlctCompSameNCsc, hAlctCompTotal, hAlctCompTotal2, hAlctCompTotal2i, hAlctCompTotal2x, hAlctCompTotalCsc, MyStubComparison::has_data, MyStubComparison::has_emul, mps_fire::i, CSCDetId::iChamberType(), TreePerStub::init(), MyStubComparison::init(), CSCBadChambers::isInBadChamber(), dqmiolumiharvest::j, MyStubComparison::key_WG_data, MyStubComparison::key_WG_emul, LogTrace, maxRing(), MyStubComparison::nEvents, MyStubComparison::nStub_data, MyStubComparison::nStub_emul, or, perStub, MyStubComparison::quality_data, MyStubComparison::quality_emul, DetId::rawId(), relativeConstraints::ring, CSCDetId::ring(), MyStubComparison::ring, RUN_, hgcalPlots::stat, CSCDetId::station(), MyStubComparison::station, stub_tree, stubs_comparison, TreePerStub::t_chamber, TreePerStub::t_endcap, TreePerStub::t_EventNumberAnalyzed, TreePerStub::t_nStubs, TreePerStub::t_nStubs_readout, TreePerStub::t_ring, TreePerStub::t_station, MyStubComparison::totStubs_data, MyStubComparison::totStubs_emul, MyStubComparison::totStubs_emul_readout, CSCDetId::triggerCscId(), CSCDetId::triggerSector(), MyStubComparison::trknmb_data, and MyStubComparison::trknmb_emul.

Referenced by compare().

1395  {
1396  int emul_corr_bx;
1397 
1398  // Should be taken from config. parameters.
1399  int fifo_pretrig = 10;
1400  int fpga_latency = 6;
1401  int l1a_window_width = 7;
1402  // Time offset of raw hits w.r.t. the full 12-bit BXN.
1403  int rawhit_tbin_offset = (fifo_pretrig - fpga_latency) + (l1a_window_width - 1) / 2;
1404  // Extra difference due to additional register stages; determined
1405  // empirically.
1406  int register_delay = 2;
1407  // Loop over all chambers in search for ALCTs.
1408  std::vector<CSCALCTDigi>::const_iterator pd, pe;
1409  for (int endc = 1; endc <= 2; endc++) {
1410  for (int stat = 1; stat <= 4; stat++) {
1411  for (int ring = 1; ring <= maxRing(stat); ring++) {
1412  for (int cham = 1; cham <= 36; cham++) {
1413  // Calculate DetId. 0th layer means whole chamber.
1414  CSCDetId detid(endc, stat, ring, cham, 0);
1415 
1416  // Skip chambers marked as bad.
1418  continue;
1419  std::vector<CSCALCTDigi> alctV_data, alctV_emul;
1420  const auto& drange = alcts_data->get(detid);
1421  for (auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
1422  if ((*digiIt).isValid()) {
1423  alctV_data.push_back(*digiIt);
1424  }
1425  }
1426 
1427  const auto& erange = alcts_emul->get(detid);
1428  std::vector<bool> bookedalctV_emul;
1429  for (auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
1430  if ((*digiIt).isValid()) {
1431  alctV_emul.push_back(*digiIt);
1432  bookedalctV_emul.push_back(false);
1433  }
1434  }
1435 
1436  int ndata = alctV_data.size();
1437  int nemul = alctV_emul.size();
1438 
1439  if (ndata == 0 && nemul == 0)
1440  continue;
1441  bool firstfill = true;
1442 
1443  if (debug or (stat == 1 and ring == 1 and (ndata != nemul))) {
1444  ostringstream strstrm;
1445  strstrm << "\n--- ME" << ((detid.endcap() == 1) ? "+" : "-") << detid.station() << "/" << detid.ring()
1446  << "/" << detid.chamber() << " (sector " << detid.triggerSector() << " trig id. "
1447  << detid.triggerCscId() << "):\n";
1448  strstrm << " **** " << ndata << " valid data ALCTs found:\n";
1449  for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) {
1450  strstrm << " " << (*pd) << " Full BX = " << (*pd).getFullBX() << "\n";
1451  }
1452  strstrm << " **** " << nemul << " valid emul ALCTs found:\n";
1453  for (pe = alctV_emul.begin(); pe != alctV_emul.end(); pe++) {
1454  strstrm << " " << (*pe);
1455  for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) {
1456  if ((*pd).getTrknmb() == (*pe).getTrknmb()) {
1457  int emul_bx = (*pe).getBX();
1458  emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay;
1459  strstrm << " Corr BX = " << emul_corr_bx;
1460  break;
1461  }
1462  }
1463  strstrm << "\n";
1464  }
1465  LogTrace("CSCTriggerPrimitivesReader") << strstrm.str();
1466  //if (stat==1 && ring==1)
1467  // std::cout <<"ME11 CompareALCTs "<< strstrm.str()<< std::endl;
1468  }
1469 
1470  //Data, add HS quality later
1471  int perEv_nStub_data = 0;
1472  int perEv_nStub_emul = 0;
1473  perStub[0].init(RUN_, Event_);
1474  perStub[1].init(RUN_, Event_);
1475  for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) {
1476  perEv_nStub_data++;
1477  }
1478  perStub[0].t_endcap = endc;
1479  perStub[0].t_station = stat;
1480  perStub[0].t_chamber = cham;
1481  perStub[0].t_ring = ring;
1483  perStub[0].t_nStubs = ndata;
1484  perStub[0].t_nStubs_readout = ndata;
1485  event_tree[0]->Fill();
1486  //Emul
1487  for (pe = alctV_emul.begin(); pe != alctV_emul.end(); pe++) {
1488  perEv_nStub_emul++;
1489  }
1490  perStub[1].t_endcap = endc;
1491  perStub[1].t_station = stat;
1492  perStub[1].t_chamber = cham;
1493  perStub[1].t_ring = ring;
1495  perStub[1].t_nStubs = nemul;
1496  perStub[1].t_nStubs_readout = nemul;
1497  event_tree[1]->Fill();
1498 
1499  int csctype = getCSCType(detid);
1500  hAlctCompFoundCsc[endc - 1][csctype]->Fill(cham);
1501  int mychamber = chamberSerial(detid);
1502  hAlctCompFound->Fill(mychamber);
1503  int ix = chamberIX(detid);
1504  int ix2 = chamberIXi(detid);
1505  // printf("station %i, ring %i, chamber %i, ix+(detid.ring()-1) %i\n",
1506  // detid.station(),detid.ring(),detid.chamber(),ix);
1507  if (detid.station() > 1 && detid.ring() == 1) {
1508  hAlctCompFound2x->Fill(ix, detid.chamber() * 2);
1509  } else {
1510  hAlctCompFound2->Fill(ix, detid.chamber());
1511  }
1512  hAlctCompFound2i->Fill(ix2, detid.chamber());
1513 
1514  if (ndata != nemul) {
1515  LogTrace("CSCTriggerPrimitivesReader")
1516  << " +++ Different numbers of ALCTs found in ME" << ((endc == 1) ? "+" : "-") << stat << "/" << ring
1517  << "/" << cham << ": data = " << ndata << " emulator = " << nemul << " +++\n";
1518  } else {
1519  hAlctCompSameNCsc[endc - 1][csctype]->Fill(cham);
1520  if (detid.station() > 1 && detid.ring() == 1) {
1521  hAlctCompSameN2x->Fill(ix, detid.chamber() * 2);
1522  } else {
1523  hAlctCompSameN2->Fill(ix, detid.chamber());
1524  }
1525  hAlctCompSameN2i->Fill(ix2, detid.chamber());
1526  }
1527 
1528  for (int i = 0; i < ndata; i++) {
1529  if (alctV_data[i].isValid() == 0)
1530  continue;
1531  int data_trknmb = alctV_data[i].getTrknmb();
1532  //int data_quality = alctV_data[i].getQuality();
1533  //int data_accel = alctV_data[i].getAccelerator();
1534  //int data_collB = alctV_data[i].getCollisionB();
1535  int data_wiregroup = alctV_data[i].getKeyWG();
1536  int data_bx = alctV_data[i].getBX();
1537 
1539  stubs_comparison[0].firstfill = firstfill;
1540  if (firstfill)
1541  firstfill = false;
1543  stubs_comparison[0].endcap = endc;
1545  stubs_comparison[0].ring = ring;
1547  stubs_comparison[0].chambertype = detid.iChamberType();
1548  stubs_comparison[0].totStubs_data = ndata;
1549  stubs_comparison[0].totStubs_emul = nemul;
1551  stubs_comparison[0].nStub_data = i + 1;
1552  stubs_comparison[0].has_data = true;
1553  stubs_comparison[0].quality_data = alctV_data[i].getQuality();
1554  stubs_comparison[0].key_WG_data = alctV_data[i].getKeyWG();
1555  stubs_comparison[0].bx_data = data_bx;
1556  stubs_comparison[0].fullbx_data = alctV_data[i].getFullBX();
1557  stubs_comparison[0].trknmb_data = data_trknmb;
1558  GlobalPoint gp_alct_data(getGlobalPosition(detid.rawId(), data_wiregroup, 60));
1559  stubs_comparison[0].eta_data = gp_alct_data.eta();
1560  for (int j = 0; j < nemul; j++) {
1561  if (alctV_emul[j].isValid() == 0)
1562  continue;
1563  if (bookedalctV_emul[j])
1564  continue; //used alct
1565 
1566  int emul_trknmb = alctV_emul[j].getTrknmb();
1567  //int emul_quality = alctV_emul[j].getQuality();
1568  //int emul_accel = alctV_emul[j].getAccelerator();
1569  //int emul_collB = alctV_emul[j].getCollisionB();
1570  int emul_wiregroup = alctV_emul[j].getKeyWG();
1571  int emul_bx = alctV_emul[j].getBX();
1572  // Emulator BX re-calculated for comparison with BX in the data.
1573  emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay;
1574  if (dataIsAnotherMC_)
1575  emul_corr_bx = emul_bx;
1576 
1577  if (ndata == nemul) {
1578  hAlctCompTotal->Fill(mychamber);
1579  hAlctCompTotalCsc[endc - 1][csctype]->Fill(cham);
1580  if (detid.station() > 1 && detid.ring() == 1) {
1581  hAlctCompTotal2x->Fill(ix, detid.chamber() * 2);
1582  } else {
1583  hAlctCompTotal2->Fill(ix, detid.chamber());
1584  }
1585  hAlctCompTotal2i->Fill(ix2, detid.chamber());
1586  }
1587  if (data_trknmb == emul_trknmb) {
1588  if (abs(data_wiregroup - emul_wiregroup) <= 2) {
1589  hAlctCompMatchCsc[endc - 1][csctype]->Fill(cham);
1590  hAlctCompMatch->Fill(mychamber);
1591  if (detid.station() > 1 && detid.ring() == 1) {
1592  hAlctCompMatch2x->Fill(ix, detid.chamber() * 2);
1593  } else {
1594  hAlctCompMatch2->Fill(ix, detid.chamber());
1595  }
1596  hAlctCompMatch2i->Fill(ix2, detid.chamber());
1597  }
1598  if (debug)
1599  LogTrace("CSCTriggerPrimitivesReader") << " Identical ALCTs #" << data_trknmb;
1600  stubs_comparison[0].nStub_emul = j + 1;
1601  stubs_comparison[0].has_emul = true;
1602  stubs_comparison[0].quality_emul = alctV_emul[j].getQuality();
1603  stubs_comparison[0].key_WG_emul = alctV_emul[j].getKeyWG();
1604  stubs_comparison[0].bx_emul = alctV_emul[j].getBX();
1605  stubs_comparison[0].trknmb_emul = emul_trknmb;
1606  GlobalPoint gp_alct_emul(getGlobalPosition(detid.rawId(), emul_wiregroup, 60));
1607  stubs_comparison[0].eta_emul = gp_alct_emul.eta();
1608  stubs_comparison[0].bx_corr_emul = emul_corr_bx;
1609  bookedalctV_emul[j] = true;
1610  break;
1611  } else {
1612  LogTrace("CSCTriggerPrimitivesReader")
1613  << " Different ALCTs #" << data_trknmb << " in ME" << ((endc == 1) ? "+" : "-") << stat << "/"
1614  << ring << "/" << cham;
1615  }
1616 
1617  } //loop emul
1618  if (debug and stubs_comparison[0].key_WG_data != stubs_comparison[0].key_WG_emul)
1619  LogTrace("CSCTriggerPrimitivesReader")
1620  << " not matched ALCT from data " << alctV_data[i] << " stubs_comparison 0 key_WG_data "
1621  << stubs_comparison[0].key_WG_data << " key_WG_emul " << stubs_comparison[0].key_WG_emul;
1622  //if (stat==1) std::cout <<" stub_tree filled , ring "<< stubs_comparison[0].ring << std::endl;
1623  //cout <<"ALCT data BX "<< stubs_comparison[0].bx_data <<" WG "<< stubs_comparison[0].key_WG_data <<" emul BX "<< stubs_comparison[0].bx_emul<<" emul BX corrected "<< stubs_comparison[0].bx_corr_emul <<" WG "<< stubs_comparison[0].key_WG_emul << endl;
1624  stub_tree[0]->Fill();
1625  } //loop data
1626  for (int i = 0; i < nemul; i++) {
1627  if (alctV_emul[i].isValid() == 0 or bookedalctV_emul[i])
1628  continue;
1629  int emul_bx = alctV_emul[i].getBX();
1631  stubs_comparison[0].firstfill = firstfill;
1632  if (firstfill)
1633  firstfill = false;
1635  stubs_comparison[0].endcap = endc;
1637  stubs_comparison[0].ring = ring;
1639  stubs_comparison[0].chambertype = detid.iChamberType();
1640  stubs_comparison[0].totStubs_data = ndata;
1641  stubs_comparison[0].totStubs_emul = nemul;
1643  stubs_comparison[0].nStub_data = -1;
1644  stubs_comparison[0].nStub_emul = i + 1;
1645  stubs_comparison[0].has_data = false;
1646  stubs_comparison[0].has_emul = true;
1647  stubs_comparison[0].trknmb_emul = alctV_emul[i].getTrknmb();
1648  stubs_comparison[0].quality_emul = alctV_emul[i].getQuality();
1649  stubs_comparison[0].key_WG_emul = alctV_emul[i].getKeyWG();
1650  stubs_comparison[0].bx_emul = alctV_emul[i].getBX();
1651  stubs_comparison[0].fullbx_emul = alctV_emul[i].getFullBX();
1652  GlobalPoint gp_alct_emul(getGlobalPosition(detid.rawId(), alctV_emul[i].getKeyWG(), 60));
1653  stubs_comparison[0].eta_emul = gp_alct_emul.eta();
1654  // Emulator BX re-calculated for comparison with BX in the data.
1655  emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay;
1656  if (dataIsAnotherMC_)
1657  emul_corr_bx = emul_bx;
1658  stubs_comparison[0].bx_corr_emul = emul_corr_bx;
1659  stub_tree[0]->Fill();
1660  if (debug)
1661  LogTrace("CSCTriggerPrimitivesReader") << "not matched ALCT from emulation " << alctV_emul[i];
1662 
1663  } //loop emul
1664  }
1665  }
1666  }
1667  }
1668 } // compare ALCT
GlobalPoint getGlobalPosition(unsigned int rawId, int keWg, int keyHS) const
TH1F * hAlctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
void init(int run, int event)
TH1F * hAlctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
TH1F * hAlctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define LogTrace(id)
TH1F * hAlctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
void init(int run, int event)
void CSCTriggerPrimitivesReader::compareCLCTs ( const CSCCLCTDigiCollection clcts_data,
const CSCCLCTDigiCollection clcts_emul,
const CSCCLCTPreTriggerDigiCollection pretrigs_emul 
)
private

Definition at line 1670 of file CSCTriggerPrimitivesReader.cc.

References funct::abs(), badChambers_, MyStubComparison::bend_data, MyStubComparison::bend_emul, MyStubComparison::bend_pretrig, MyStubComparison::bx_corr_emul, MyStubComparison::bx_data, MyStubComparison::bx_emul, MyStubComparison::bx_pretrig, relativeConstraints::cham, CSCDetId::chamber(), MyStubComparison::chamber, chamberIX(), chamberIXi(), MyStubComparison::chambertype, checkBadChambers_, dataIsAnotherMC_, debug, MyStubComparison::endcap, CSCDetId::endcap(), Event_, event_tree, eventsAnalyzed, MyStubComparison::firstfill, MyStubComparison::fullbx_data, MyStubComparison::fullbx_emul, MuonDigiCollection< IndexType, DigiType >::get(), getCSCType(), getGlobalPosition(), MyStubComparison::has_data, MyStubComparison::has_emul, hClctCompFound2, hClctCompFound2i, hClctCompFound2x, hClctCompFoundCsc, hClctCompMatch2, hClctCompMatch2i, hClctCompMatch2x, hClctCompMatchCsc, hClctCompSameN2, hClctCompSameN2i, hClctCompSameN2x, hClctCompSameNCsc, hClctCompTotal2, hClctCompTotal2i, hClctCompTotal2x, hClctCompTotalCsc, mps_fire::i, CSCDetId::iChamberType(), TreePerStub::init(), MyStubComparison::init(), CSCBadChambers::isInBadChamber(), dqmiolumiharvest::j, dqmdumpme::k, MyStubComparison::key_hs_data, MyStubComparison::key_hs_emul, MyStubComparison::key_hs_pretrig, LogTrace, MyStubComparison::maxpattern_pretrig, MyStubComparison::maxquality_pretrig, maxRing(), MyStubComparison::nEvents, MyStubComparison::npretrig, MyStubComparison::nStub_data, MyStubComparison::nStub_emul, or, MyStubComparison::pattern_data, MyStubComparison::pattern_emul, MyStubComparison::pattern_pretrig, perStub, PV3DBase< T, PVType, FrameType >::phi(), MyStubComparison::phi_data, MyStubComparison::phi_emul, MyStubComparison::quality_data, MyStubComparison::quality_emul, MyStubComparison::quality_pretrig, DetId::rawId(), relativeConstraints::ring, CSCDetId::ring(), MyStubComparison::ring, RUN_, hgcalPlots::stat, CSCDetId::station(), MyStubComparison::station, stub_tree, stubs_comparison, TreePerStub::t_chamber, TreePerStub::t_endcap, TreePerStub::t_EventNumberAnalyzed, TreePerStub::t_nStubs, TreePerStub::t_nStubs_readout, TreePerStub::t_ring, TreePerStub::t_station, MyStubComparison::totStubs_data, MyStubComparison::totStubs_emul, MyStubComparison::totStubs_emul_readout, CSCDetId::triggerCscId(), CSCDetId::triggerSector(), MyStubComparison::trknmb_data, and MyStubComparison::trknmb_emul.

Referenced by compare().

1672  {
1673  // Number of Tbins before pre-trigger for raw cathode hits.
1674  const int tbin_cathode_offset = 7;
1675  //const int tbin_cathode_offset = 8;//in MC, it became 8, Tao
1676  const int pretrig_trig_zone = 5; // max distance between CLCT key hs and pretrigger hs
1677 
1678  // Loop over all chambers in search for CLCTs.
1679  std::vector<CSCCLCTDigi>::const_iterator pd, pe;
1680  std::vector<CSCCLCTPreTriggerDigi>::const_iterator pretrig;
1681  perStub[2].init(RUN_, Event_);
1682  perStub[3].init(RUN_, Event_);
1683  for (int endc = 1; endc <= 2; endc++) {
1684  for (int stat = 1; stat <= 4; stat++) {
1685  for (int ring = 1; ring <= maxRing(stat); ring++) {
1686  for (int cham = 1; cham <= 36; cham++) {
1687  // Calculate DetId. 0th layer means whole chamber.
1688  CSCDetId detid(endc, stat, ring, cham, 0);
1689 
1690  // Skip chambers marked as bad.
1692  continue;
1693 
1694  std::vector<CSCCLCTDigi> clctV_data, clctV_emul;
1695  const auto& drange = clcts_data->get(detid);
1696  for (auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
1697  if ((*digiIt).isValid()) {
1698  clctV_data.push_back(*digiIt);
1699  }
1700  }
1701 
1702  const auto& erange = clcts_emul->get(detid);
1703  std::vector<bool> bookedclctV_emul;
1704  for (auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
1705  if ((*digiIt).isValid()) {
1706  for (auto pclct : clctV_emul) {
1707  if (digiIt->getBX() != pclct.getBX() and abs(digiIt->getBX() - pclct.getBX()) < 5)
1708  LogTrace("CSCTriggerPrimitivesReader")
1709  << "Two CLCTs very close in timing!!! Special event: first clct " << pclct << " second clct "
1710  << *digiIt << std::endl;
1711  }
1712  clctV_emul.push_back(*digiIt);
1713  bookedclctV_emul.push_back(false);
1714  }
1715  }
1716 
1717  std::vector<CSCCLCTPreTriggerDigi> pretrigV_emul;
1718  const auto& pretrigrange = pretrigs_emul->get(detid);
1719  for (auto pretrigIt = pretrigrange.first; pretrigIt != pretrigrange.second; pretrigIt++) {
1720  if ((*pretrigIt).isValid()) {
1721  pretrigV_emul.push_back(*pretrigIt);
1722  }
1723  }
1724 
1725  int ndata = clctV_data.size();
1726  int nemul = clctV_emul.size();
1727  if (ndata == 0 && nemul == 0)
1728  continue;
1729  bool firstfill = true;
1730  int nemul_readout = 0;
1731  for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1732  for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1733  int emul_bx = (*pe).getBX();
1734  int corr_bx = ((*pd).getFullBX() + emul_bx - tbin_cathode_offset) & 0x03;
1735  int bx_data = pd->getBX();
1736  //if (corr_bx == bx_data or abs(pe->getKeyStrip() - pd->getKeyStrip())<=1){//if emulated BX after correction is same as data bx, it will be readout
1737  if (corr_bx == bx_data) { //if emulated BX after correction is same as data bx, it will be readout
1738  nemul_readout++;
1739  break;
1740  }
1741  }
1742  }
1743 
1744  if (debug or nemul > ndata or (ndata != nemul) or ndata != nemul_readout) {
1745  LogTrace("CSCTriggerPrimitivesReader")
1746  << " CLCTs from data " << ndata << " CLCTs from emul " << nemul << " readout " << nemul_readout;
1747  ostringstream strstrm;
1748  strstrm << "\n--- ME" << ((detid.endcap() == 1) ? "+" : "-") << detid.station() << "/" << detid.ring()
1749  << "/" << detid.chamber() << " (sector " << detid.triggerSector() << " trig id. "
1750  << detid.triggerCscId() << "):\n";
1751  strstrm << " **** " << ndata << " valid data CLCTs found:\n";
1752  for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1753  strstrm << " " << (*pd) << " Full BX = " << (*pd).getFullBX() << "\n";
1754  }
1755  strstrm << " **** " << nemul << " valid emul CLCTs found:\n";
1756  for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1757  strstrm << " " << (*pe);
1758  for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1759  if ((*pd).getTrknmb() == (*pe).getTrknmb() or abs((*pe).getKeyStrip() - (*pd).getKeyStrip()) < 5) {
1760  int emul_bx = (*pe).getBX();
1761  int corr_bx = ((*pd).getFullBX() + emul_bx - tbin_cathode_offset) & 0x03;
1762  strstrm << " Corr BX = " << corr_bx;
1763  break;
1764  }
1765  }
1766  strstrm << "\n";
1767  }
1768  LogTrace("CSCTriggerPrimitivesReader") << strstrm.str();
1769  }
1770  if (nemul_readout > 2) { //reduce nemul_readout to 2 by hand
1771  //cout <<"CLCT matching nemul readout is "<< nemul_readout <<", larger than 2. reduce it to 2 by hand"<<endl;
1772  nemul_readout = 2;
1773  }
1774 
1775  //Per event Fill, From Luca
1776  //Data, add HS quality later
1777  int perEv_nStub_data = 0;
1778  int perEv_nStub_emul = 0;
1779  perStub[2].init(RUN_, Event_);
1780  perStub[3].init(RUN_, Event_);
1781  for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1782  perEv_nStub_data++;
1783  }
1784  perStub[2].t_endcap = endc;
1785  perStub[2].t_station = stat;
1786  perStub[2].t_chamber = cham;
1787  perStub[2].t_ring = ring;
1789  perStub[2].t_nStubs = ndata;
1790  perStub[2].t_nStubs_readout = ndata;
1791  event_tree[2]->Fill();
1792  //Emul
1793  for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1794  perEv_nStub_emul++;
1795  }
1796  perStub[3].t_endcap = endc;
1797  perStub[3].t_station = stat;
1798  perStub[3].t_chamber = cham;
1799  perStub[3].t_ring = ring;
1801  perStub[3].t_nStubs = nemul;
1802  perStub[3].t_nStubs_readout = nemul_readout;
1803  event_tree[3]->Fill();
1804 
1805  int csctype = getCSCType(detid);
1806  hClctCompFoundCsc[endc - 1][csctype]->Fill(cham);
1807  int ix = chamberIX(detid);
1808  int ix2 = chamberIXi(detid);
1809  if (detid.station() > 1 && detid.ring() == 1) {
1810  hClctCompFound2x->Fill(ix, detid.chamber() * 2);
1811  } else {
1812  hClctCompFound2->Fill(ix, detid.chamber());
1813  }
1814  hClctCompFound2i->Fill(ix2, detid.chamber());
1815  if (ndata != nemul) {
1816  LogTrace("CSCTriggerPrimitivesReader")
1817  //cerr
1818  << " +++ Different numbers of CLCTs found in ME" << ((endc == 1) ? "+" : "-") << stat << "/" << ring
1819  << "/" << cham << ": data = " << ndata << " emulator = " << nemul << " +++\n";
1820  } else {
1821  hClctCompSameNCsc[endc - 1][csctype]->Fill(cham);
1822  if (detid.station() > 1 && detid.ring() == 1) {
1823  hClctCompSameN2x->Fill(ix, detid.chamber() * 2);
1824  } else {
1825  hClctCompSameN2->Fill(ix, detid.chamber());
1826  }
1827  hClctCompSameN2i->Fill(ix2, detid.chamber());
1828  }
1829  int i = -1;
1830  int testwg = 20;
1831  for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1832  i++;
1833  if ((*pd).isValid() == 0)
1834  continue;
1835  int data_trknmb = (*pd).getTrknmb();
1836  int data_quality = (*pd).getQuality();
1837  int data_pattern = (*pd).getPattern();
1838  int data_striptype = (*pd).getStripType();
1839  int data_bend = (*pd).getBend();
1840  int data_keystrip = (*pd).getKeyStrip();
1841  int data_cfeb = (*pd).getCFEB();
1842  int data_bx = (*pd).getBX();
1843  int fullBX = (*pd).getFullBX(); // 12-bit full BX
1844 
1845  if (data_keystrip >= 128 and stat == 1 and ring == 1)
1846  testwg = 5;
1847  else
1848  testwg = 20;
1849 
1851  stubs_comparison[1].firstfill = firstfill;
1852  if (firstfill)
1853  firstfill = false;
1855  stubs_comparison[1].endcap = endc;
1857  stubs_comparison[1].ring = ring;
1859  stubs_comparison[1].chambertype = detid.iChamberType();
1860  stubs_comparison[1].totStubs_data = ndata;
1861  stubs_comparison[1].totStubs_emul = nemul;
1862  stubs_comparison[1].totStubs_emul_readout = nemul_readout;
1863  stubs_comparison[1].nStub_data = i + 1;
1864  stubs_comparison[1].has_data = true;
1865  stubs_comparison[1].quality_data = (*pd).getQuality();
1866  stubs_comparison[1].key_hs_data = (*pd).getKeyStrip();
1867  stubs_comparison[1].bend_data = (*pd).getBend();
1868  stubs_comparison[1].pattern_data = (*pd).getPattern();
1869  stubs_comparison[1].bx_data = (*pd).getBX();
1870  stubs_comparison[1].fullbx_data = (*pd).getFullBX();
1871  stubs_comparison[1].trknmb_data = data_trknmb;
1872  GlobalPoint gp_clct_data(getGlobalPosition(detid.rawId(), testwg, (*pd).getKeyStrip()));
1873  stubs_comparison[1].phi_data = gp_clct_data.phi();
1874 
1875  int j = -1;
1876  for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1877  j++;
1878  if ((*pe).isValid() == 0)
1879  continue;
1880  if (bookedclctV_emul[j])
1881  continue; //used alct
1882  int emul_trknmb = (*pe).getTrknmb();
1883  int emul_quality = (*pe).getQuality();
1884  int emul_pattern = (*pe).getPattern();
1885  int emul_striptype = (*pe).getStripType();
1886  int emul_bend = (*pe).getBend();
1887  int emul_keystrip = (*pe).getKeyStrip();
1888  int emul_cfeb = (*pe).getCFEB();
1889  int emul_bx = (*pe).getBX();
1890 
1891  if (abs(data_keystrip - emul_keystrip) <= 2) {
1892  // Emulator BX re-calculated using 12-bit full BX number.
1893  // Used for comparison with BX in the data.
1894  int emul_corr_bx = (fullBX + emul_bx - tbin_cathode_offset) & 0x03;
1895  //std::cout <<"CLCT data_bx "<< data_bx <<" emul_corr_bx "<< emul_corr_bx << std::endl;
1896  if (dataIsAnotherMC_)
1897  emul_corr_bx = (emul_bx & 0x03);
1898  if (ndata == nemul) {
1899  hClctCompTotalCsc[endc - 1][csctype]->Fill(cham);
1900  if (detid.station() > 1 && detid.ring() == 1) {
1901  hClctCompTotal2x->Fill(ix, detid.chamber() * 2);
1902  } else {
1903  hClctCompTotal2->Fill(ix, detid.chamber());
1904  }
1905  hClctCompTotal2i->Fill(ix2, detid.chamber());
1906  }
1907  if (data_quality == emul_quality && data_pattern == emul_pattern && data_striptype == emul_striptype &&
1908  data_bend == emul_bend && data_keystrip == emul_keystrip && data_cfeb == emul_cfeb) {
1909  if (ndata == nemul) {
1910  hClctCompMatchCsc[endc - 1][csctype]->Fill(cham);
1911  if (detid.station() > 1 && detid.ring() == 1) {
1912  hClctCompMatch2x->Fill(ix, detid.chamber() * 2);
1913  } else {
1914  hClctCompMatch2->Fill(ix, detid.chamber());
1915  }
1916  hClctCompMatch2i->Fill(ix2, detid.chamber());
1917  }
1918  if (debug)
1919  LogTrace("CSCTriggerPrimitivesReader") << " Identical CLCTs #" << data_trknmb;
1920  } else {
1921  LogTrace("CSCTriggerPrimitivesReader")
1922  << " Different CLCTs #" << data_trknmb << " in ME" << ((endc == 1) ? "+" : "-") << stat
1923  << "/" << ring << "/" << cham << " data_bx " << data_bx << " emul_corr_bx " << emul_corr_bx;
1924  }
1925  stubs_comparison[1].nStub_emul = j + 1;
1926  stubs_comparison[1].has_emul = true;
1927  stubs_comparison[1].quality_emul = (*pe).getQuality();
1928  stubs_comparison[1].key_hs_emul = (*pe).getKeyStrip();
1929  stubs_comparison[1].bend_emul = (*pe).getBend();
1930  stubs_comparison[1].pattern_emul = (*pe).getPattern();
1931  stubs_comparison[1].bx_emul = (*pe).getBX();
1932  stubs_comparison[1].bx_corr_emul = emul_corr_bx;
1933  stubs_comparison[1].trknmb_emul = emul_trknmb;
1934  GlobalPoint gp_clct_emul(getGlobalPosition(detid.rawId(), testwg, (*pe).getKeyStrip()));
1935  stubs_comparison[1].phi_emul = gp_clct_emul.phi();
1936  bookedclctV_emul[j] = true;
1937 
1938  //int mingap_trig_pretrig = pretrig_trig_zone*2;
1939  int num_pretrig = 0;
1940  for (pretrig = pretrigV_emul.begin(); pretrig != pretrigV_emul.end(); pretrig++) {
1941  if ((*pretrig).getBX() != (*pe).getBX())
1942  continue;
1943  int hsgap = std::abs((*pretrig).getKeyStrip() - (*pe).getKeyStrip());
1944  bool samechamber = true;
1945  if (stat == 1 and ring == 1)
1946  samechamber = (((*pretrig).getKeyStrip() < 128 and (*pe).getKeyStrip() < 128) ||
1947  ((*pretrig).getKeyStrip() >= 128 and (*pe).getKeyStrip() >= 128));
1948  if (not samechamber)
1949  continue;
1950 
1951  if (hsgap <= pretrig_trig_zone)
1952  num_pretrig++;
1953  else
1954  continue;
1955  if ((*pretrig).getPattern() > stubs_comparison[1].maxpattern_pretrig)
1956  stubs_comparison[1].maxpattern_pretrig = (*pretrig).getPattern();
1957  if ((*pretrig).getQuality() > stubs_comparison[1].maxquality_pretrig) {
1958  stubs_comparison[1].quality_pretrig = (*pretrig).getQuality();
1959  stubs_comparison[1].key_hs_pretrig = (*pretrig).getKeyStrip();
1960  stubs_comparison[1].bend_pretrig = (*pretrig).getBend();
1961  stubs_comparison[1].pattern_pretrig = (*pretrig).getPattern();
1962  stubs_comparison[1].bx_pretrig = (*pretrig).getBX();
1963  }
1964  }
1965  stubs_comparison[1].npretrig = num_pretrig;
1966  break;
1967  } //if (data_trknmb == emul_trknmb)
1968  } //loop emul
1969  if (debug and stubs_comparison[1].key_hs_data != stubs_comparison[1].key_hs_emul)
1970  LogTrace("CSCTriggerPrimitivesReader")
1971  << "CSCDetid " << detid << " not matched CLCT from data " << (*pd)
1972  << " stubs_comparison 1 key_hs_data " << stubs_comparison[1].key_hs_data << " key_hs_emul "
1973  << stubs_comparison[1].key_hs_emul << endl;
1974  //cout <<"CLCT data BX "<< stubs_comparison[1].bx_data <<" emul BX "<< stubs_comparison[1].bx_emul<<" emul BX corrected "<< stubs_comparison[1].bx_corr_emul << endl;
1975  stub_tree[1]->Fill();
1976  } //loop data
1977  for (int k = 0; k < nemul; k++) {
1978  if (clctV_emul[i].isValid() == 0)
1979  continue;
1980  if (bookedclctV_emul[k])
1981  continue;
1983  stubs_comparison[1].firstfill = firstfill;
1984  if (firstfill)
1985  firstfill = false;
1987  stubs_comparison[1].endcap = endc;
1989  stubs_comparison[1].ring = ring;
1991  stubs_comparison[1].chambertype = detid.iChamberType();
1992  stubs_comparison[1].totStubs_data = ndata;
1993  stubs_comparison[1].totStubs_emul = nemul;
1994  stubs_comparison[1].totStubs_emul_readout = nemul_readout;
1995  stubs_comparison[1].trknmb_emul = clctV_emul[i].getTrknmb();
1996  stubs_comparison[1].nStub_data = -1;
1997  stubs_comparison[1].has_data = false;
1998  stubs_comparison[1].nStub_emul = k + 1;
1999  stubs_comparison[1].has_emul = true;
2000  stubs_comparison[1].quality_emul = clctV_emul[k].getQuality();
2001  stubs_comparison[1].key_hs_emul = clctV_emul[k].getKeyStrip();
2002  stubs_comparison[1].bend_emul = clctV_emul[k].getBend();
2003  stubs_comparison[1].pattern_emul = clctV_emul[k].getPattern();
2004  stubs_comparison[1].bx_emul = clctV_emul[k].getBX();
2005  stubs_comparison[1].fullbx_emul = clctV_emul[k].getFullBX();
2006  if (clctV_emul[k].getKeyStrip() >= 128 and stat == 1 and ring == 1)
2007  testwg = 5;
2008  else
2009  testwg = 20;
2010  // Emulator BX NOT Known from the data.
2011  GlobalPoint gp_clct_emul(getGlobalPosition(detid.rawId(), testwg, clctV_emul[k].getKeyStrip()));
2012  stubs_comparison[1].phi_emul = gp_clct_emul.phi();
2013  bookedclctV_emul[k] = true;
2014  stub_tree[1]->Fill();
2015  }
2016  }
2017  }
2018  }
2019  } // for all chambers
2020 } // compareCLCTs
TH1F * hClctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
GlobalPoint getGlobalPosition(unsigned int rawId, int keWg, int keyHS) const
TH1F * hClctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
Range get(const IndexType &index) const
return the digis for a given DetUnit
void init(int run, int event)
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
TH1F * hClctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define LogTrace(id)
TH1F * hClctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
void init(int run, int event)
void CSCTriggerPrimitivesReader::compareLCTs ( const CSCCorrelatedLCTDigiCollection lcts_data,
const CSCCorrelatedLCTDigiCollection lcts_emul,
const CSCALCTDigiCollection alcts_data,
const CSCCLCTDigiCollection clcts_data 
)
private

Definition at line 2022 of file CSCTriggerPrimitivesReader.cc.

References funct::abs(), badChambers_, MyStubComparison::bend_data, MyStubComparison::bend_emul, MyStubComparison::bx_corr_emul, MyStubComparison::bx_data, MyStubComparison::bx_emul, relativeConstraints::cham, CSCDetId::chamber(), MyStubComparison::chamber, chamberIX(), chamberIXi(), MyStubComparison::chambertype, checkBadChambers_, convertBXofLCT(), dataIsAnotherMC_, debug, doesALCTCrossCLCT(), MyStubComparison::endcap, CSCDetId::endcap(), PV3DBase< T, PVType, FrameType >::eta(), MyStubComparison::eta_data, MyStubComparison::eta_emul, Event_, event_tree, eventsAnalyzed, MyStubComparison::firstfill, getCSCType(), getGlobalPosition(), MyStubComparison::has_data, MyStubComparison::has_emul, hLCTCompFound2, hLCTCompFound2i, hLCTCompFound2x, hLctCompFoundCsc, hLCTCompMatch2, hLCTCompMatch2i, hLCTCompMatch2x, hLctCompMatchCsc, hLCTCompSameN2, hLCTCompSameN2i, hLCTCompSameN2x, hLctCompSameNCsc, hLCTCompTotal2, hLCTCompTotal2i, hLCTCompTotal2x, hLctCompTotalCsc, mps_fire::i, CSCDetId::iChamberType(), TreePerStub::init(), MyStubComparison::init(), CSCBadChambers::isInBadChamber(), dqmiolumiharvest::j, dqmdumpme::k, MyStubComparison::key_hs_data, MyStubComparison::key_hs_emul, MyStubComparison::key_WG_data, MyStubComparison::key_WG_emul, LogTrace, maxRing(), MyStubComparison::nEvents, MyStubComparison::nStub_data, MyStubComparison::nStub_emul, or, MyStubComparison::pattern_data, MyStubComparison::pattern_emul, perStub, PV3DBase< T, PVType, FrameType >::phi(), MyStubComparison::phi_data, MyStubComparison::phi_emul, MyStubComparison::quality_data, MyStubComparison::quality_emul, DetId::rawId(), relativeConstraints::ring, CSCDetId::ring(), MyStubComparison::ring, RUN_, hgcalPlots::stat, CSCDetId::station(), MyStubComparison::station, stub_tree, stubs_comparison, TreePerStub::t_chamber, TreePerStub::t_endcap, TreePerStub::t_EventNumberAnalyzed, TreePerStub::t_nStubs, TreePerStub::t_nStubs_readout, TreePerStub::t_ring, TreePerStub::t_station, MyStubComparison::totStubs_data, MyStubComparison::totStubs_emul, MyStubComparison::totStubs_emul_readout, CSCDetId::triggerCscId(), CSCDetId::triggerSector(), MyStubComparison::trknmb_data, MyStubComparison::trknmb_emul, MyStubComparison::WGcrossHS_data, and MyStubComparison::WGcrossHS_emul.

Referenced by compare().

2025  {
2026  // Need ALCT and CLCT digi collections to convert emulator bx into
2027  // hardware bx.
2028  // Loop over all chambers in search for correlated LCTs.
2029  std::vector<CSCCorrelatedLCTDigi>::const_iterator pd, pe;
2030  for (int endc = 1; endc <= 2; endc++) {
2031  for (int stat = 1; stat <= 4; stat++) {
2032  for (int ring = 1; ring <= maxRing(stat); ring++) {
2033  for (int cham = 1; cham <= 36; cham++) {
2034  // Calculate DetId. 0th layer means whole chamber.
2035  CSCDetId detid(endc, stat, ring, cham, 0);
2036 
2037  // Skip chambers marked as bad.
2039  continue;
2040 
2041  std::vector<CSCCorrelatedLCTDigi> lctV_data, lctV_emul;
2042  std::vector<bool> bookedlctV_emul;
2043  const auto& drange = lcts_data->get(detid);
2044  for (auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
2045  if ((*digiIt).isValid()) {
2046  lctV_data.push_back(*digiIt);
2047  }
2048  }
2049 
2050  const auto& erange = lcts_emul->get(detid);
2051  for (auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
2052  if ((*digiIt).isValid()) {
2053  lctV_emul.push_back(*digiIt);
2054  bookedlctV_emul.push_back(false);
2055  }
2056  }
2057 
2058  int ndata = lctV_data.size();
2059  int nemul = lctV_emul.size();
2060  if (ndata == 0 && nemul == 0)
2061  continue;
2062  bool firstfill = true;
2063  int nemul_readout = 0;
2064  for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2065  for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2066  int bx_data = pd->getBX();
2067  int bx_corr = convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data);
2068  if ((bx_data == bx_corr) or (abs(pe->getKeyWG() - pd->getKeyWG()) <= 2)) {
2069  nemul_readout++;
2070  break;
2071  }
2072  }
2073  }
2074 
2075  if (debug or nemul > ndata or (nemul_readout != ndata) or nemul != ndata) {
2076  LogTrace("CSCTriggerPrimitivesReader")
2077  << " LCTs from data " << ndata << " LCTs from emul " << nemul << " readout " << nemul_readout;
2078  ostringstream strstrm;
2079  strstrm << "\n--- ME" << ((detid.endcap() == 1) ? "+" : "-") << detid.station() << "/" << detid.ring()
2080  << "/" << detid.chamber() << " (sector " << detid.triggerSector() << " trig id. "
2081  << detid.triggerCscId() << "):\n";
2082  strstrm << " **** " << ndata << " valid data LCTs found:\n";
2083  for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2084  strstrm << " " << (*pd);
2085  }
2086  strstrm << "\n **** " << nemul << " valid emul LCTs found:\n";
2087  for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2088  strstrm << " " << (*pe);
2089  strstrm << " corr BX = " << convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data);
2090  strstrm << " LCT pattern = " << (*pe).getPattern();
2091  strstrm << "\n";
2092  }
2093  LogTrace("CSCTriggerPrimitivesReader") << strstrm.str();
2094  //std::cout <<"CompareLCTs "<< strstrm.str()<< std::endl;
2095  }
2096  if (nemul_readout > 2) { //reduce nemul_readout to 2 by hand
2097  //cout <<"LCT matching nemul readout is "<< nemul_readout <<", larger than 2. reduce it to 2 by hand"<<endl;
2098  nemul_readout = 2;
2099  }
2100 
2101  //
2102  //Data, add HS quality later
2103  int perEv_nStub_data = 0;
2104  int perEv_nStub_emul = 0;
2105  perStub[4].init(RUN_, Event_);
2106  perStub[5].init(RUN_, Event_);
2107  for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2108  perEv_nStub_data++;
2109  }
2110  perStub[4].t_endcap = endc;
2111  perStub[4].t_station = stat;
2112  perStub[4].t_chamber = cham;
2113  perStub[4].t_ring = ring;
2115  perStub[4].t_nStubs = ndata;
2116  perStub[4].t_nStubs_readout = ndata;
2117  event_tree[4]->Fill();
2118  //Emul
2119  for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2120  perEv_nStub_emul++;
2121  }
2122  perStub[5].t_endcap = endc;
2123  perStub[5].t_station = stat;
2124  perStub[5].t_chamber = cham;
2125  perStub[5].t_ring = ring;
2127  perStub[5].t_nStubs = nemul;
2128  perStub[5].t_nStubs_readout = nemul_readout;
2129  event_tree[5]->Fill();
2130 
2131  int csctype = getCSCType(detid);
2132  hLctCompFoundCsc[endc - 1][csctype]->Fill(cham);
2133  int ix = chamberIX(detid);
2134  int ix2 = chamberIXi(detid);
2135  if (detid.station() > 1 && detid.ring() == 1) {
2136  hLCTCompFound2x->Fill(ix, detid.chamber() * 2);
2137  } else {
2138  hLCTCompFound2->Fill(ix, detid.chamber());
2139  }
2140  hLCTCompFound2i->Fill(ix2, detid.chamber());
2141  if (ndata != nemul) {
2142  LogTrace("CSCTriggerPrimitivesReader")
2143  //cerr
2144  << " +++ Different numbers of LCTs found in ME" << ((endc == 1) ? "+" : "-") << stat << "/" << ring
2145  << "/" << cham << ": data = " << ndata << " emulator = " << nemul << " +++\n";
2146  } else {
2147  hLctCompSameNCsc[endc - 1][csctype]->Fill(cham);
2148  if (detid.station() > 1 && detid.ring() == 1) {
2149  hLCTCompSameN2x->Fill(ix, detid.chamber() * 2);
2150  } else {
2151  hLCTCompSameN2->Fill(ix, detid.chamber());
2152  }
2153  hLCTCompSameN2i->Fill(ix2, detid.chamber());
2154  }
2155  int i = -1;
2156  for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2157  i++;
2158  if ((*pd).isValid() == 0)
2159  continue;
2160  int data_trknmb = (*pd).getTrknmb();
2161  int data_quality = (*pd).getQuality();
2162  int data_wiregroup = (*pd).getKeyWG();
2163  int data_keystrip = (*pd).getStrip();
2164  int data_pattern = (*pd).getCLCTPattern();
2165  int data_striptype = (*pd).getStripType();
2166  int data_bend = (*pd).getBend();
2167  int data_bx = (*pd).getBX();
2168 
2170  stubs_comparison[2].firstfill = firstfill;
2171  if (firstfill)
2172  firstfill = false;
2174  stubs_comparison[2].endcap = endc;
2176  stubs_comparison[2].ring = ring;
2178  stubs_comparison[2].chambertype = detid.iChamberType();
2179  stubs_comparison[2].totStubs_data = ndata;
2180  stubs_comparison[2].totStubs_emul = nemul;
2181  stubs_comparison[2].totStubs_emul_readout = nemul_readout;
2182  stubs_comparison[2].nStub_data = i + 1;
2183  stubs_comparison[2].has_data = true;
2184  stubs_comparison[2].quality_data = (*pd).getQuality();
2185  stubs_comparison[2].key_WG_data = (*pd).getKeyWG();
2186  stubs_comparison[2].key_hs_data = (*pd).getStrip();
2187  //cout <<" CSC detid "<< detid <<" LCT in data "<< (*pd) <<" do doesALCTCrossCLCT "<< endl;
2188  stubs_comparison[2].WGcrossHS_data = doesALCTCrossCLCT(detid, (*pd).getKeyWG(), (*pd).getStrip());
2189  stubs_comparison[2].bend_data = (*pd).getBend();
2190  stubs_comparison[2].pattern_data = (*pd).getCLCTPattern();
2191  stubs_comparison[2].bx_data = (*pd).getBX();
2192  stubs_comparison[2].trknmb_data = data_trknmb;
2193  GlobalPoint gp_lct_data(getGlobalPosition(detid.rawId(), (*pd).getKeyWG(), (*pd).getStrip()));
2194  stubs_comparison[2].eta_data = gp_lct_data.eta();
2195  stubs_comparison[2].phi_data = gp_lct_data.phi();
2196  int j = -1;
2197  for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2198  j++;
2199  if ((*pe).isValid() == 0)
2200  continue;
2201  if (bookedlctV_emul[j])
2202  continue; //used alct
2203  int emul_trknmb = (*pe).getTrknmb();
2204  int emul_quality = (*pe).getQuality();
2205  int emul_wiregroup = (*pe).getKeyWG();
2206  int emul_keystrip = (*pe).getStrip();
2207  int emul_pattern = (*pe).getCLCTPattern();
2208  int emul_striptype = (*pe).getStripType();
2209  int emul_bend = (*pe).getBend();
2210  int emul_bx = (*pe).getBX();
2211  if (abs(data_keystrip - emul_keystrip) <= 2 || abs(data_wiregroup - emul_wiregroup) <= 2) {
2212  // Convert emulator BX into hardware BX using full 12-bit
2213  // BX words in ALCT and CLCT digi collections.
2214  int emul_corr_bx = convertBXofLCT(emul_bx, detid, alcts_data, clcts_data);
2215  //std::cout <<"LCT data_bx "<< data_bx <<" emul_corr_bx "<< emul_corr_bx << std::endl;
2216  if (dataIsAnotherMC_)
2217  emul_corr_bx = (emul_bx & 0x01);
2218 
2219  if (ndata == nemul) {
2220  hLctCompTotalCsc[endc - 1][csctype]->Fill(cham);
2221  if (detid.station() > 1 && detid.ring() == 1) {
2222  hLCTCompTotal2x->Fill(ix, detid.chamber() * 2);
2223  } else {
2224  hLCTCompTotal2->Fill(ix, detid.chamber());
2225  }
2226  hLCTCompTotal2i->Fill(ix2, detid.chamber());
2227  }
2228  if (data_quality == emul_quality && data_wiregroup == emul_wiregroup &&
2229  data_keystrip == emul_keystrip && data_pattern == emul_pattern &&
2230  data_striptype == emul_striptype && data_bend == emul_bend) {
2231  if (ndata == nemul) {
2232  hLctCompMatchCsc[endc - 1][csctype]->Fill(cham);
2233  if (detid.station() > 1 && detid.ring() == 1) {
2234  hLCTCompMatch2x->Fill(ix, detid.chamber() * 2);
2235  } else {
2236  hLCTCompMatch2->Fill(ix, detid.chamber());
2237  }
2238  hLCTCompMatch2i->Fill(ix2, detid.chamber());
2239  }
2240  if (debug)
2241  LogTrace("CSCTriggerPrimitivesReader") << " Identical LCTs #" << data_trknmb;
2242  } else {
2243  LogTrace("CSCTriggerPrimitivesReader")
2244  << " Different LCTs #" << data_trknmb << " in ME" << ((endc == 1) ? "+" : "-") << stat
2245  << "/" << ring << "/" << cham << " data_lct bx " << data_bx << " emul bx " << emul_corr_bx;
2246  }
2247  stubs_comparison[2].nStub_emul = j + 1;
2248  stubs_comparison[2].has_emul = true;
2249  stubs_comparison[2].quality_emul = (*pe).getQuality();
2250  stubs_comparison[2].key_WG_emul = (*pe).getKeyWG();
2251  stubs_comparison[2].key_hs_emul = (*pe).getStrip();
2252  stubs_comparison[2].bend_emul = (*pe).getBend();
2253  stubs_comparison[2].pattern_emul = (*pe).getCLCTPattern();
2254  stubs_comparison[2].bx_emul = (*pe).getBX();
2255  //cout <<" CSC detid "<< detid <<" LCT in emul "<< (*pe) <<" do doesALCTCrossCLCT "<< endl;
2256  stubs_comparison[2].WGcrossHS_emul = doesALCTCrossCLCT(detid, (*pe).getKeyWG(), (*pe).getStrip());
2257  stubs_comparison[2].bx_corr_emul = emul_corr_bx;
2258  stubs_comparison[2].trknmb_emul = emul_trknmb;
2259  GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), (*pe).getKeyWG(), (*pe).getStrip()));
2260  stubs_comparison[2].eta_emul = gp_lct_emul.eta();
2261  stubs_comparison[2].phi_emul = gp_lct_emul.phi();
2262  bookedlctV_emul[j] = true;
2263  break;
2264  } //if (data_trknmb == emul_trknmb)
2265  } //loop emul
2266  if (debug and stubs_comparison[2].key_hs_data != stubs_comparison[2].key_hs_emul)
2267  LogTrace("CSCTriggerPrimitivesReader")
2268  << "CSCDetid " << detid << " not matched LCT from Data " << (*pd)
2269  << " stubs_comparison 2 key_hs_data " << stubs_comparison[2].key_hs_data << " key_hs_emul "
2270  << stubs_comparison[2].key_hs_emul << endl;
2271  stub_tree[2]->Fill();
2272  } //loop data
2273  for (int k = 0; k < nemul; k++) {
2274  if (bookedlctV_emul[k])
2275  continue;
2276  if (lctV_emul[i].isValid() == 0)
2277  continue;
2280  stubs_comparison[2].endcap = endc;
2282  stubs_comparison[2].ring = ring;
2284  stubs_comparison[2].chambertype = detid.iChamberType();
2285  stubs_comparison[2].totStubs_data = ndata;
2286  stubs_comparison[2].totStubs_emul = nemul;
2287  stubs_comparison[2].totStubs_emul_readout = nemul_readout;
2288  stubs_comparison[2].trknmb_emul = lctV_emul[i].getTrknmb();
2289  stubs_comparison[2].nStub_data = -1;
2290  stubs_comparison[2].has_data = false;
2291  stubs_comparison[2].nStub_emul = k + 1;
2292  stubs_comparison[2].has_emul = true;
2294  doesALCTCrossCLCT(detid, lctV_emul[k].getKeyWG(), lctV_emul[k].getStrip());
2295  stubs_comparison[2].quality_emul = lctV_emul[k].getQuality();
2296  stubs_comparison[2].key_WG_emul = lctV_emul[k].getKeyWG();
2297  stubs_comparison[2].key_hs_emul = lctV_emul[k].getStrip();
2298  stubs_comparison[2].bend_emul = lctV_emul[k].getBend();
2299  stubs_comparison[2].pattern_emul = lctV_emul[k].getCLCTPattern();
2300  stubs_comparison[2].bx_emul = lctV_emul[k].getBX();
2301  //stubs_comparison[2].fullbx_emul = lctV_emul[k].getFullBX();
2302  // Emulator BX NOT Known from the data.
2303  GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), lctV_emul[k].getKeyWG(), lctV_emul[k].getStrip()));
2304  stubs_comparison[2].eta_emul = gp_lct_emul.eta();
2305  stubs_comparison[2].phi_emul = gp_lct_emul.phi();
2306  bookedlctV_emul[k] = true;
2307  stub_tree[2]->Fill();
2308  }
2309  }
2310  }
2311  }
2312  }
2313 }
GlobalPoint getGlobalPosition(unsigned int rawId, int keWg, int keyHS) const
int convertBXofLCT(const int emul_bx, const CSCDetId &detid, const CSCALCTDigiCollection *alcts_data, const CSCCLCTDigiCollection *clcts_data)
TH1F * hLctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
bool doesALCTCrossCLCT(CSCDetId id, int key_wg, int key_hs) const
void init(int run, int event)
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
TH1F * hLctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TH1F * hLctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
#define LogTrace(id)
void init(int run, int event)
TH1F * hLctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
void CSCTriggerPrimitivesReader::compareMPCLCTs ( const CSCCorrelatedLCTDigiCollection lcts_data,
const CSCCorrelatedLCTDigiCollection lcts_emul,
const CSCALCTDigiCollection alcts_data,
const CSCCLCTDigiCollection clcts_data 
)
private

Definition at line 2315 of file CSCTriggerPrimitivesReader.cc.

References badChambers_, MyStubComparison::bend_data, MyStubComparison::bend_emul, MyStubComparison::bx_corr_emul, MyStubComparison::bx_data, MyStubComparison::bx_emul, relativeConstraints::cham, CSCDetId::chamber(), MyStubComparison::chamber, MyStubComparison::chambertype, checkBadChambers_, convertBXofLCT(), dataIsAnotherMC_, debug, doesALCTCrossCLCT(), MyStubComparison::endcap, CSCDetId::endcap(), PV3DBase< T, PVType, FrameType >::eta(), MyStubComparison::eta_data, MyStubComparison::eta_emul, Event_, eventsAnalyzed, MyStubComparison::firstfill, getGlobalPosition(), MyStubComparison::has_data, MyStubComparison::has_emul, mps_fire::i, CSCDetId::iChamberType(), MyStubComparison::init(), CSCBadChambers::isInBadChamber(), dqmiolumiharvest::j, dqmdumpme::k, MyStubComparison::key_hs_data, MyStubComparison::key_hs_emul, MyStubComparison::key_WG_data, MyStubComparison::key_WG_emul, LogTrace, maxRing(), MyStubComparison::nEvents, MyStubComparison::nStub_data, MyStubComparison::nStub_emul, MyStubComparison::pattern_data, MyStubComparison::pattern_emul, PV3DBase< T, PVType, FrameType >::phi(), MyStubComparison::phi_data, MyStubComparison::phi_emul, MyStubComparison::quality_data, MyStubComparison::quality_emul, DetId::rawId(), relativeConstraints::ring, CSCDetId::ring(), MyStubComparison::ring, RUN_, hgcalPlots::stat, CSCDetId::station(), MyStubComparison::station, stub_tree, stubs_comparison, MyStubComparison::totStubs_data, MyStubComparison::totStubs_emul, CSCDetId::triggerCscId(), CSCDetId::triggerSector(), MyStubComparison::trknmb_data, MyStubComparison::trknmb_emul, MyStubComparison::WGcrossHS_data, and MyStubComparison::WGcrossHS_emul.

2318  {
2319  // Need ALCT and CLCT digi collections to convert emulator bx into
2320  // hardware bx.
2321  // Loop over all chambers in search for correlated LCTs.
2322  std::vector<CSCCorrelatedLCTDigi>::const_iterator pd, pe;
2323  for (int endc = 1; endc <= 2; endc++) {
2324  for (int stat = 1; stat <= 4; stat++) {
2325  for (int ring = 1; ring <= maxRing(stat); ring++) {
2326  for (int cham = 1; cham <= 36; cham++) {
2327  // Calculate DetId. 0th layer means whole chamber.
2328  CSCDetId detid(endc, stat, ring, cham, 0);
2329 
2330  // Skip chambers marked as bad.
2332  continue;
2333 
2334  std::vector<CSCCorrelatedLCTDigi> lctV_data, lctV_emul;
2335  std::vector<bool> bookedlctV_emul;
2336  const auto& drange = lcts_data->get(detid);
2337  for (auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
2338  if ((*digiIt).isValid()) {
2339  lctV_data.push_back(*digiIt);
2340  }
2341  }
2342 
2343  const auto& erange = lcts_emul->get(detid);
2344  for (auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
2345  if ((*digiIt).isValid()) {
2346  lctV_emul.push_back(*digiIt);
2347  bookedlctV_emul.push_back(false);
2348  }
2349  }
2350 
2351  int ndata = lctV_data.size();
2352  int nemul = lctV_emul.size();
2353  if (ndata == 0 && nemul == 0)
2354  continue;
2355  bool firstfill = true;
2356 
2357  if (debug) {
2358  ostringstream strstrm;
2359  strstrm << "\n--- ME" << ((detid.endcap() == 1) ? "+" : "-") << detid.station() << "/" << detid.ring()
2360  << "/" << detid.chamber() << " (sector " << detid.triggerSector() << " trig id. "
2361  << detid.triggerCscId() << "):\n";
2362  strstrm << " **** " << ndata << " valid data LCTs found:\n";
2363  for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2364  strstrm << " " << (*pd);
2365  }
2366  strstrm << "\n **** " << nemul << " valid emul LCTs found:\n";
2367  for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2368  strstrm << " " << (*pe);
2369  strstrm << " corr BX = " << convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data);
2370  strstrm << " LCT pattern = " << (*pe).getPattern();
2371  strstrm << "\n";
2372  }
2373  LogTrace("CSCTriggerPrimitivesReader") << strstrm.str();
2374  //std::cout <<"CompareLCTs "<< strstrm.str()<< std::endl;
2375  }
2376 
2377  //int ix = chamberIX(detid);
2378  //int ix2 = chamberIXi(detid);
2379  if (ndata != nemul) {
2380  LogTrace("CSCTriggerPrimitivesReader")
2381  << " +++ Different numbers of MPC LCTs found in ME" << ((endc == 1) ? "+" : "-") << stat << "/"
2382  << ring << "/" << cham << ": data = " << ndata << " emulator = " << nemul << " +++\n";
2383  }
2384  /*else {
2385  hLctCompSameNCsc[endc-1][csctype]->Fill(cham);
2386  if(detid.station()>1 && detid.ring()==1) {
2387  hLCTCompSameN2x->Fill(ix,detid.chamber()*2);
2388  }
2389  else {
2390  hLCTCompSameN2->Fill(ix,detid.chamber());
2391  }
2392  hLCTCompSameN2i->Fill(ix2,detid.chamber());
2393  }*/
2394  int i = -1;
2395  for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2396  i++;
2397  if ((*pd).isValid() == 0)
2398  continue;
2399  int data_trknmb = (*pd).getTrknmb();
2400  int data_quality = (*pd).getQuality();
2401  int data_wiregroup = (*pd).getKeyWG();
2402  int data_keystrip = (*pd).getStrip();
2403  int data_pattern = (*pd).getCLCTPattern();
2404  int data_striptype = (*pd).getStripType();
2405  int data_bend = (*pd).getBend();
2406  int data_bx = (*pd).getBX();
2407 
2409  stubs_comparison[3].firstfill = firstfill;
2410  if (firstfill)
2411  firstfill = false;
2413  stubs_comparison[3].endcap = endc;
2415  stubs_comparison[3].ring = ring;
2417  stubs_comparison[3].chambertype = detid.iChamberType();
2418  stubs_comparison[3].totStubs_data = ndata;
2419  stubs_comparison[3].totStubs_emul = nemul;
2420  stubs_comparison[3].nStub_data = i + 1;
2421  stubs_comparison[3].has_data = true;
2422  stubs_comparison[3].WGcrossHS_data = doesALCTCrossCLCT(detid, (*pd).getKeyWG(), (*pd).getStrip());
2423  stubs_comparison[3].quality_data = (*pd).getQuality();
2424  stubs_comparison[3].key_WG_data = (*pd).getKeyWG();
2425  stubs_comparison[3].key_hs_data = (*pd).getStrip();
2426  stubs_comparison[3].bend_data = (*pd).getBend();
2427  stubs_comparison[3].pattern_data = (*pd).getCLCTPattern();
2428  stubs_comparison[3].bx_data = (*pd).getBX();
2429  stubs_comparison[3].trknmb_data = data_trknmb;
2430  GlobalPoint gp_lct_data(getGlobalPosition(detid.rawId(), (*pd).getKeyWG(), (*pd).getStrip()));
2431  stubs_comparison[3].eta_data = gp_lct_data.eta();
2432  stubs_comparison[3].phi_data = gp_lct_data.phi();
2433  int j = -1;
2434  for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2435  j++;
2436  if ((*pe).isValid() == 0)
2437  continue;
2438  int emul_trknmb = (*pe).getTrknmb();
2439  int emul_quality = (*pe).getQuality();
2440  int emul_wiregroup = (*pe).getKeyWG();
2441  int emul_keystrip = (*pe).getStrip();
2442  int emul_pattern = (*pe).getCLCTPattern();
2443  int emul_striptype = (*pe).getStripType();
2444  int emul_bend = (*pe).getBend();
2445  int emul_bx = (*pe).getBX();
2446  if (data_trknmb == emul_trknmb) {
2447  // Convert emulator BX into hardware BX using full 12-bit
2448  // BX words in ALCT and CLCT digi collections.
2449  int emul_corr_bx = convertBXofLCT(emul_bx, detid, alcts_data, clcts_data);
2450  //std::cout <<"LCT data_bx "<< data_bx <<" emul_corr_bx "<< emul_corr_bx << std::endl;
2451  if (dataIsAnotherMC_)
2452  emul_corr_bx = (emul_bx & 0x01);
2453 
2454  /*if (ndata == nemul) {
2455  hLctCompTotalCsc[endc-1][csctype]->Fill(cham);
2456  if(detid.station()>1 && detid.ring()==1) {
2457  hLCTCompTotal2x->Fill(ix,detid.chamber()*2);
2458  }
2459  else {
2460  hLCTCompTotal2->Fill(ix,detid.chamber());
2461  }
2462  hLCTCompTotal2i->Fill(ix2,detid.chamber());
2463  }*/
2464  if (data_quality == emul_quality && data_wiregroup == emul_wiregroup &&
2465  data_keystrip == emul_keystrip && data_pattern == emul_pattern &&
2466  data_striptype == emul_striptype && data_bend == emul_bend) {
2467  //data_bx == emul_corr_bx) {
2468  /*if (ndata == nemul) {
2469  hLctCompMatchCsc[endc-1][csctype]->Fill(cham);
2470  if(detid.station()>1 && detid.ring()==1) {
2471  hLCTCompMatch2x->Fill(ix,detid.chamber()*2);
2472  }
2473  else {
2474  hLCTCompMatch2->Fill(ix,detid.chamber());
2475  }
2476  hLCTCompMatch2i->Fill(ix2,detid.chamber());
2477  }*/
2478  if (debug)
2479  LogTrace("CSCTriggerPrimitivesReader") << " Identical LCTs #" << data_trknmb;
2480  stubs_comparison[3].nStub_emul = j + 1;
2481  stubs_comparison[3].has_emul = true;
2482  stubs_comparison[3].WGcrossHS_emul = doesALCTCrossCLCT(detid, (*pe).getKeyWG(), (*pe).getStrip());
2483  stubs_comparison[3].quality_emul = (*pe).getQuality();
2484  stubs_comparison[3].key_WG_emul = (*pe).getKeyWG();
2485  stubs_comparison[3].key_hs_emul = (*pe).getStrip();
2486  stubs_comparison[3].bend_emul = (*pe).getBend();
2487  stubs_comparison[3].pattern_emul = (*pe).getCLCTPattern();
2488  stubs_comparison[3].bx_emul = (*pe).getBX();
2489  stubs_comparison[3].bx_corr_emul = emul_corr_bx;
2490  stubs_comparison[3].trknmb_emul = emul_trknmb;
2491  GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), (*pe).getKeyWG(), (*pe).getStrip()));
2492  stubs_comparison[3].eta_emul = gp_lct_emul.eta();
2493  stubs_comparison[3].phi_emul = gp_lct_emul.phi();
2494  bookedlctV_emul[j] = true;
2495  break;
2496  } else {
2497  LogTrace("CSCTriggerPrimitivesReader")
2498  //cerr
2499  << " Different LCTs #" << data_trknmb << " in ME" << ((endc == 1) ? "+" : "-") << stat
2500  << "/" << ring << "/" << cham << " data_lct bx " << data_bx << " emul bx " << emul_corr_bx;
2501  }
2502  }
2503  } //loop emul
2504  if (debug and stubs_comparison[3].key_hs_data != stubs_comparison[3].key_hs_emul)
2505  LogTrace("CSCTriggerPrimitivesReader")
2506  << "stubs_comparison 2 key_hs_data " << stubs_comparison[3].key_hs_data << " key_hs_emul "
2508  stub_tree[3]->Fill();
2509  } //loop data
2510 
2511  for (int k = 0; k < nemul; k++) {
2512  if (bookedlctV_emul[k])
2513  continue;
2515  stubs_comparison[3].firstfill = firstfill;
2516  if (firstfill)
2517  firstfill = false;
2519  stubs_comparison[3].endcap = endc;
2521  stubs_comparison[3].ring = ring;
2523  stubs_comparison[3].chambertype = detid.iChamberType();
2524  stubs_comparison[3].totStubs_data = ndata;
2525  stubs_comparison[3].totStubs_emul = nemul;
2526  stubs_comparison[3].trknmb_emul = lctV_emul[i].getTrknmb();
2527  stubs_comparison[3].nStub_data = -1;
2528  stubs_comparison[3].has_data = false;
2529  stubs_comparison[3].nStub_emul = k + 1;
2530  stubs_comparison[3].has_emul = true;
2532  doesALCTCrossCLCT(detid, lctV_emul[k].getKeyWG(), lctV_emul[k].getStrip());
2533  stubs_comparison[3].quality_emul = lctV_emul[k].getQuality();
2534  stubs_comparison[3].key_WG_emul = lctV_emul[k].getKeyWG();
2535  stubs_comparison[3].key_hs_emul = lctV_emul[k].getStrip();
2536  stubs_comparison[3].bend_emul = lctV_emul[k].getBend();
2537  stubs_comparison[3].pattern_emul = lctV_emul[k].getCLCTPattern();
2538  stubs_comparison[3].bx_emul = lctV_emul[k].getBX();
2539  //stubs_comparison[2].fullbx_emul = lctV_emul[k].getFullBX();
2540  // Emulator BX NOT Known from the data.
2541  GlobalPoint gp_lct_emul(getGlobalPosition(detid.rawId(), lctV_emul[k].getKeyWG(), lctV_emul[k].getStrip()));
2542  stubs_comparison[3].eta_emul = gp_lct_emul.eta();
2543  stubs_comparison[3].phi_emul = gp_lct_emul.phi();
2544  bookedlctV_emul[k] = true;
2545  stub_tree[3]->Fill();
2546  }
2547  } //end loop of chambers
2548  }
2549  }
2550  }
2551 }
GlobalPoint getGlobalPosition(unsigned int rawId, int keWg, int keyHS) const
int convertBXofLCT(const int emul_bx, const CSCDetId &detid, const CSCALCTDigiCollection *alcts_data, const CSCCLCTDigiCollection *clcts_data)
bool doesALCTCrossCLCT(CSCDetId id, int key_wg, int key_hs) const
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
#define LogTrace(id)
void init(int run, int event)
int CSCTriggerPrimitivesReader::convertBXofLCT ( const int  emul_bx,
const CSCDetId detid,
const CSCALCTDigiCollection alcts_data,
const CSCCLCTDigiCollection clcts_data 
)
private

Definition at line 2553 of file CSCTriggerPrimitivesReader.cc.

Referenced by compareLCTs(), and compareMPCLCTs().

2556  {
2557  int full_anode_bx = -999;
2558  //int full_cathode_bx = -999;
2559  int lct_bx = -999;
2560  int tbin_anode_offset = 5; // 2007, run 14419.
2561 
2562  // Extract full 12-bit anode BX word from ALCT collections.
2563  const auto& arange = alcts_data->get(detid);
2564  for (auto digiIt = arange.first; digiIt != arange.second; digiIt++) {
2565  if ((*digiIt).isValid()) {
2566  full_anode_bx = (*digiIt).getFullBX();
2567  break;
2568  }
2569  }
2570 
2571  // Extract full 12-bit cathode BX word from CLCT collections.
2572  const auto& crange = clcts_data->get(detid);
2573  for (auto digiIt = crange.first; digiIt != crange.second; digiIt++) {
2574  if ((*digiIt).isValid()) {
2575  //full_cathode_bx = (*digiIt).getFullBX();
2576  break;
2577  }
2578  }
2579 
2580  // Use these 12-bit BX's to convert emulator BX into hardware BX.
2581  if (full_anode_bx == -999) {
2582  // What to do???
2583  edm::LogWarning("L1CSCTPEmulatorWrongInput") << "+++ Warning in convertBXofLCT(): full anode BX is not available!"
2584  << " +++\n";
2585  } else {
2586  // LCT BX has two bits: the least-significant bit is the LSB of ALCT BX;
2587  // the MSB is 1/0 depending on whether the 12-bit full cathode BX is 0
2588  // or not.
2589  lct_bx = (full_anode_bx + emul_bx - tbin_anode_offset) & 0x01;
2590  // SV, 12/Jun/08: it looks like this bit is never set - docu must be
2591  // wrong.
2592  //lct_bx = lct_bx | ((full_cathode_bx == 0) << 1);
2593  }
2594  //std::cout <<"convertBXofLCT old emul_bx "<< emul_bx <<" new lct bx "<< lct_bx <<" ful_anode_bx "<< full_anode_bx << std::endl;
2595  return lct_bx;
2596 }
bool CSCTriggerPrimitivesReader::doesALCTCrossCLCT ( CSCDetId  id,
int  key_wg,
int  key_hs 
) const
private

Definition at line 4658 of file CSCTriggerPrimitivesReader.cc.

References gangedME1a, lut_wg_vs_hs_me1a, lut_wg_vs_hs_me1ag, lut_wg_vs_hs_me1b, CSCConstants::MAX_HALF_STRIP_ME1A_GANGED, CSCConstants::MAX_HALF_STRIP_ME1A_UNGANGED, CSCConstants::MAX_HALF_STRIP_ME1B, or, and relativeConstraints::ring.

Referenced by compareLCTs(), and compareMPCLCTs().

4658  {
4659  bool isME11 = (id.station() == 1 and (id.ring() == 1 or id.ring() == 4));
4660  if (not isME11)
4661  return true;
4662 
4663  int theEndcap = (id.endcap() == 1) ? 1 : 2;
4664 
4665  if (key_hs > CSCConstants::MAX_HALF_STRIP_ME1B) {
4666  key_hs = key_hs - CSCConstants::MAX_HALF_STRIP_ME1B - 1; //convert it from 128-223 -> 0-95
4667  if (!gangedME1a) {
4668  // wrap around ME11 HS number for -z endcap
4669  if (theEndcap == 2)
4671  if (key_hs >= lut_wg_vs_hs_me1a[key_wg][0] && key_hs <= lut_wg_vs_hs_me1a[key_wg][1])
4672  return true;
4673  return false;
4674  } else {
4675  if (theEndcap == 2)
4676  key_hs = CSCConstants::MAX_HALF_STRIP_ME1A_GANGED - key_hs;
4677  if (key_hs >= lut_wg_vs_hs_me1ag[key_wg][0] && key_hs <= lut_wg_vs_hs_me1ag[key_wg][1])
4678  return true;
4679  return false;
4680  }
4681  }
4682  if (key_hs <= CSCConstants::MAX_HALF_STRIP_ME1B) {
4683  if (theEndcap == 2)
4684  key_hs = CSCConstants::MAX_HALF_STRIP_ME1B - key_hs;
4685  if (key_hs >= lut_wg_vs_hs_me1b[key_wg][0] && key_hs <= lut_wg_vs_hs_me1b[key_wg][1])
4686  return true;
4687  }
4688  return false;
4689 }
static const int lut_wg_vs_hs_me1a[48][2]
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
static const int lut_wg_vs_hs_me1b[48][2]
static const int lut_wg_vs_hs_me1ag[48][2]
void CSCTriggerPrimitivesReader::drawALCTHistos ( )
private

Definition at line 3046 of file CSCTriggerPrimitivesReader.cc.

References alignmentValidation::c1, csc_type, CSC_TYPES, alignmentValidation::fname, hAlctAccel, hAlctBXN, hAlctCollis, hAlctCsc, hAlctKeyGroup, hAlctPerChamber, hAlctPerCSC, hAlctPerEvent, hAlctQuality, hAlctValid, mps_fire::i, MAX_ENDCAPS, MAXPAGES, MainPageGenerator::page, plotME1A, plotME42, resultsFileNamesPrefix_, OrderedSet::t, and overlapproblemtsosanalyzer_cfi::title.

Referenced by endJob().

3046  {
3047  TCanvas* c1 = new TCanvas("c1", "", 0, 0, 500, 640);
3048  string fname = resultsFileNamesPrefix_ + "alcts.ps";
3049  TPostScript* ps = new TPostScript(fname.c_str(), 111);
3050 
3051  TPad* pad[MAXPAGES];
3052  for (int i_page = 0; i_page < MAXPAGES; i_page++) {
3053  pad[i_page] = new TPad("", "", .05, .05, .93, .93);
3054  }
3055 
3056  int page = 1;
3057  TText t;
3058  t.SetTextFont(32);
3059  t.SetTextSize(0.025);
3060  char pagenum[7], titl[50];
3061  TPaveLabel* title;
3062 
3063  int max_idh = plotME42 ? CSC_TYPES : CSC_TYPES - 1;
3064 
3065  ps->NewPage();
3066  c1->Clear();
3067  c1->cd(0);
3068  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "Number of ALCTs");
3069  title->SetFillColor(10);
3070  title->Draw();
3071  sprintf(pagenum, "- %d -", page);
3072  t.DrawText(0.9, 0.02, pagenum);
3073  gStyle->SetOptStat(111110);
3074  pad[page]->Draw();
3075  pad[page]->Divide(1, 3);
3076  pad[page]->cd(1);
3077  hAlctPerEvent->Draw();
3078  pad[page]->cd(2);
3079  hAlctPerChamber->Draw();
3080  for (int i = 0; i < CSC_TYPES; i++) {
3081  hAlctPerCSC->GetXaxis()->SetBinLabel(i + 1, csc_type[i].c_str());
3082  }
3083  // Should be multiplied by 40/nevents to convert to MHz
3084  pad[page]->cd(3);
3085  hAlctPerCSC->Draw();
3086  page++;
3087  c1->Update();
3088 
3089  for (int endc = 0; endc < MAX_ENDCAPS; endc++) {
3090  ps->NewPage();
3091  c1->Clear();
3092  c1->cd(0);
3093  sprintf(titl, "ALCTs per chamber, endcap %d", endc + 1);
3094  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3095  title->SetFillColor(10);
3096  title->Draw();
3097  sprintf(pagenum, "- %d -", page);
3098  t.DrawText(0.9, 0.02, pagenum);
3099  gStyle->SetOptStat(10);
3100  pad[page]->Draw();
3101  pad[page]->Divide(2, 5);
3102  for (int idh = 0; idh < max_idh; idh++) {
3103  if (!plotME1A && idh == 3)
3104  continue;
3105  hAlctCsc[endc][idh]->SetMinimum(0.0);
3106  pad[page]->cd(idh + 1);
3107  hAlctCsc[endc][idh]->Draw();
3108  }
3109  page++;
3110  c1->Update();
3111  }
3112 
3113  ps->NewPage();
3114  c1->Clear();
3115  c1->cd(0);
3116  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "ALCT quantities");
3117  title->SetFillColor(10);
3118  title->Draw();
3119  sprintf(pagenum, "- %d -", page);
3120  t.DrawText(0.9, 0.02, pagenum);
3121  gStyle->SetOptStat(111110);
3122  pad[page]->Draw();
3123  pad[page]->Divide(2, 3);
3124  pad[page]->cd(1);
3125  hAlctValid->Draw();
3126  pad[page]->cd(2);
3127  hAlctQuality->Draw();
3128  pad[page]->cd(3);
3129  hAlctAccel->Draw();
3130  pad[page]->cd(4);
3131  hAlctCollis->Draw();
3132  pad[page]->cd(5);
3133  hAlctKeyGroup->Draw();
3134  pad[page]->cd(6);
3135  hAlctBXN->Draw();
3136  page++;
3137  c1->Update();
3138 
3139  ps->Close();
3140  delete c1;
3141 }
static const std::string csc_type[CSC_TYPES]
TH1F * hAlctCsc[MAX_ENDCAPS][CSC_TYPES]
string fname
main script
void CSCTriggerPrimitivesReader::drawCLCTHistos ( )
private

Definition at line 3143 of file CSCTriggerPrimitivesReader.cc.

References alignmentValidation::c1, csc_type, CSC_TYPES, alignmentValidation::fname, hClctBendCsc, hClctBXN, hClctCFEB, hClctCsc, hClctKeyStrip, hClctPattern, hClctPerChamber, hClctPerCSC, hClctPerEvent, hClctQuality, hClctSign, hClctValid, mps_fire::i, MAX_ENDCAPS, MAXPAGES, LaserClient_cfi::nbins, MainPageGenerator::page, plotME1A, plotME42, resultsFileNamesPrefix_, OrderedSet::t, and overlapproblemtsosanalyzer_cfi::title.

Referenced by endJob().

3143  {
3144  TCanvas* c1 = new TCanvas("c1", "", 0, 0, 500, 640);
3145  string fname = resultsFileNamesPrefix_ + "clcts.ps";
3146  TPostScript* ps = new TPostScript(fname.c_str(), 111);
3147 
3148  TPad* pad[MAXPAGES];
3149  for (int i_page = 0; i_page < MAXPAGES; i_page++) {
3150  pad[i_page] = new TPad("", "", .05, .05, .93, .93);
3151  }
3152 
3153  int page = 1;
3154  TText t;
3155  t.SetTextFont(32);
3156  t.SetTextSize(0.025);
3157  char pagenum[7], titl[50];
3158  TPaveLabel* title;
3159 
3160  ps->NewPage();
3161  c1->Clear();
3162  c1->cd(0);
3163  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "Number of CLCTs");
3164  title->SetFillColor(10);
3165  title->Draw();
3166  sprintf(pagenum, "- %d -", page);
3167  t.DrawText(0.9, 0.02, pagenum);
3168  gStyle->SetOptStat(111110);
3169  pad[page]->Draw();
3170  pad[page]->Divide(1, 3);
3171  pad[page]->cd(1);
3172  hClctPerEvent->Draw();
3173 
3174  int max_idh = plotME42 ? CSC_TYPES : CSC_TYPES - 1;
3175 
3176  edm::LogInfo("CSCTriggerPrimitivesReader") << "\n";
3177  int nbins = hClctPerChamber->GetNbinsX();
3178  for (int ibin = 1; ibin <= nbins; ibin++) {
3179  double f_bin = hClctPerChamber->GetBinContent(ibin);
3180  edm::LogInfo("CSCTriggerPrimitivesReader") << " # CLCTs/chamber: " << ibin - 1 << "; events: " << f_bin << endl;
3181  }
3182 
3183  pad[page]->cd(2);
3184  hClctPerChamber->Draw();
3185  for (int i = 0; i < CSC_TYPES; i++) {
3186  hClctPerCSC->GetXaxis()->SetBinLabel(i + 1, csc_type[i].c_str());
3187  }
3188  // Should be multiplied by 40/nevents to convert to MHz
3189  pad[page]->cd(3);
3190  hClctPerCSC->Draw();
3191  page++;
3192  c1->Update();
3193 
3194  for (int endc = 0; endc < MAX_ENDCAPS; endc++) {
3195  ps->NewPage();
3196  c1->Clear();
3197  c1->cd(0);
3198  sprintf(titl, "CLCTs per chamber, endcap %d", endc + 1);
3199  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3200  title->SetFillColor(10);
3201  title->Draw();
3202  sprintf(pagenum, "- %d -", page);
3203  t.DrawText(0.9, 0.02, pagenum);
3204  gStyle->SetOptStat(10);
3205  pad[page]->Draw();
3206  pad[page]->Divide(2, 5);
3207  for (int idh = 0; idh < max_idh; idh++) {
3208  if (!plotME1A && idh == 3)
3209  continue;
3210  hClctCsc[endc][idh]->SetMinimum(0.0);
3211  pad[page]->cd(idh + 1);
3212  hClctCsc[endc][idh]->Draw();
3213  }
3214  page++;
3215  c1->Update();
3216  }
3217 
3218  ps->NewPage();
3219  c1->Clear();
3220  c1->cd(0);
3221  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "CLCT quantities");
3222  title->SetFillColor(10);
3223  title->Draw();
3224  sprintf(pagenum, "- %d -", page);
3225  t.DrawText(0.9, 0.02, pagenum);
3226  gStyle->SetOptStat(111110);
3227  pad[page]->Draw();
3228  pad[page]->Divide(2, 4);
3229  pad[page]->cd(1);
3230  hClctValid->Draw();
3231  pad[page]->cd(2);
3232  hClctQuality->Draw();
3233  pad[page]->cd(3);
3234  hClctSign->Draw();
3235  hClctPattern[1]->SetTitle("CLCT pattern #");
3236  pad[page]->cd(4);
3237  hClctPattern[1]->Draw();
3238  pad[page]->cd(5);
3239  hClctCFEB->Draw();
3240  pad[page]->cd(7);
3241  hClctKeyStrip[1]->Draw();
3242  pad[page]->cd(8);
3243  hClctBXN->Draw();
3244  page++;
3245  c1->Update();
3246 
3247  ps->NewPage();
3248  c1->Clear();
3249  c1->cd(0);
3250  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "CLCT bend for various chamber types, halfstrips");
3251  title->SetFillColor(10);
3252  title->Draw();
3253  sprintf(pagenum, "- %d -", page);
3254  t.DrawText(0.9, 0.02, pagenum);
3255  gStyle->SetOptStat(110);
3256  pad[page]->Draw();
3257  pad[page]->Divide(2, 5);
3258  for (int idh = 0; idh < max_idh; idh++) {
3259  if (!plotME1A && idh == 3)
3260  continue;
3261  pad[page]->cd(idh + 1);
3262  hClctBendCsc[idh][1]->GetXaxis()->SetTitle("Pattern bend");
3263  hClctBendCsc[idh][1]->GetYaxis()->SetTitle("Number of LCTs");
3264  hClctBendCsc[idh][1]->Draw();
3265  }
3266  page++;
3267  c1->Update();
3268 
3269  ps->Close();
3270  delete c1;
3271 }
static const std::string csc_type[CSC_TYPES]
TH1F * hClctCsc[MAX_ENDCAPS][CSC_TYPES]
string fname
main script
void CSCTriggerPrimitivesReader::drawCompHistos ( )
private

Definition at line 3506 of file CSCTriggerPrimitivesReader.cc.

References alignmentValidation::c1, CSC_TYPES, makePileupJSON::denom, relativeConstraints::error, alignmentValidation::fname, hAlctCompFoundCsc, hAlctCompMatchCsc, hAlctCompSameNCsc, hAlctCompTotalCsc, hClctCompFoundCsc, hClctCompMatchCsc, hClctCompSameNCsc, hClctCompTotalCsc, hLctCompFoundCsc, hLctCompMatchCsc, hLctCompSameNCsc, hLctCompTotalCsc, MAX_ENDCAPS, MAXPAGES, LaserClient_cfi::nbins, MainPageGenerator::page, plotME1A, plotME42, particleFlowDisplacedVertex_cfi::ratio, resultsFileNamesPrefix_, mathSSE::sqrt(), OrderedSet::t, and overlapproblemtsosanalyzer_cfi::title.

Referenced by endJob().

3506  {
3507  TCanvas* c1 = new TCanvas("c1", "", 0, 0, 500, 640);
3508  string fname = resultsFileNamesPrefix_ + "lcts_comp.ps";
3509  TPostScript* ps = new TPostScript(fname.c_str(), 111);
3510 
3511  TPad* pad[MAXPAGES];
3512  for (int i_page = 0; i_page < MAXPAGES; i_page++) {
3513  pad[i_page] = new TPad("", "", .05, .05, .93, .93);
3514  }
3515 
3516  int page = 1;
3517  TText t;
3518  t.SetTextFont(32);
3519  t.SetTextSize(0.025);
3520  char pagenum[15];
3521  TPaveLabel* title;
3522  Int_t nbins;
3523 
3524  TText teff;
3525  teff.SetTextFont(32);
3526  teff.SetTextSize(0.08);
3527  char eff[25], titl[60];
3528 
3529  int max_idh = plotME42 ? CSC_TYPES : CSC_TYPES - 1;
3530 
3531  for (int endc = 0; endc < MAX_ENDCAPS; endc++) { // endcaps
3532  ps->NewPage();
3533  c1->Clear();
3534  c1->cd(0);
3535  sprintf(titl, "ALCT firmware-emulator: match in number found, endcap %d", endc + 1);
3536  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3537  title->SetFillColor(10);
3538  title->Draw();
3539  sprintf(pagenum, "- %d -", page);
3540  t.DrawText(0.9, 0.02, pagenum);
3541  //gStyle->SetOptStat(110010);
3542  gStyle->SetOptStat(0);
3543  pad[page]->Draw();
3544  pad[page]->Divide(2, 5);
3545  TH1F* hAlctFoundEffVsCsc[MAX_ENDCAPS][CSC_TYPES];
3546  for (int idh = 0; idh < max_idh; idh++) {
3547  if (!plotME1A && idh == 3)
3548  continue;
3549  hAlctFoundEffVsCsc[endc][idh] = (TH1F*)hAlctCompFoundCsc[endc][idh]->Clone();
3550  hAlctFoundEffVsCsc[endc][idh]->Divide(hAlctCompSameNCsc[endc][idh], hAlctCompFoundCsc[endc][idh], 1., 1., "B");
3551  nbins = hAlctCompFoundCsc[endc][idh]->GetNbinsX();
3552  for (Int_t ibin = 1; ibin <= nbins; ibin++) {
3553  if (hAlctCompFoundCsc[endc][idh]->GetBinContent(ibin) == 0) {
3554  hAlctFoundEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3555  hAlctFoundEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3556  }
3557  }
3558  gPad->Update();
3559  gStyle->SetStatX(0.65);
3560  hAlctFoundEffVsCsc[endc][idh]->SetMinimum(-0.05);
3561  hAlctFoundEffVsCsc[endc][idh]->SetMaximum(1.05);
3562  hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3563  hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3564  hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06); // default=0.04
3565  hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06); // default=0.04
3566  hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07); // default=0.05
3567  hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07); // default=0.05
3568  hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitle("CSC id");
3569  hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitle("% of same number found");
3570  pad[page]->cd(idh + 1);
3571  hAlctFoundEffVsCsc[endc][idh]->Draw("e");
3572  double numer = hAlctCompSameNCsc[endc][idh]->Integral();
3573  double denom = hAlctCompFoundCsc[endc][idh]->Integral();
3574  double ratio = 0.0, error = 0.0;
3575  if (denom > 0.) {
3576  ratio = numer / denom;
3577  error = sqrt(ratio * (1. - ratio) / denom);
3578  }
3579  sprintf(eff, "eff = (%4.1f +/- %4.1f)%%", ratio * 100., error * 100.);
3580  teff.DrawTextNDC(0.3, 0.5, eff);
3581  }
3582  page++;
3583  c1->Update();
3584  }
3585 
3586  for (int endc = 0; endc < MAX_ENDCAPS; endc++) { // endcaps
3587  ps->NewPage();
3588  c1->Clear();
3589  c1->cd(0);
3590  sprintf(titl, "ALCT firmware-emulator: exact match, endcap %d", endc + 1);
3591  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3592  title->SetFillColor(10);
3593  title->Draw();
3594  sprintf(pagenum, "- %d -", page);
3595  t.DrawText(0.9, 0.02, pagenum);
3596  //gStyle->SetOptStat(110010);
3597  gStyle->SetOptStat(0);
3598  pad[page]->Draw();
3599  pad[page]->Divide(2, 5);
3600  TH1F* hAlctMatchEffVsCsc[MAX_ENDCAPS][CSC_TYPES];
3601  for (int idh = 0; idh < max_idh; idh++) {
3602  if (!plotME1A && idh == 3)
3603  continue;
3604  hAlctMatchEffVsCsc[endc][idh] = (TH1F*)hAlctCompTotalCsc[endc][idh]->Clone();
3605  hAlctMatchEffVsCsc[endc][idh]->Divide(hAlctCompMatchCsc[endc][idh], hAlctCompTotalCsc[endc][idh], 1., 1., "B");
3606  nbins = hAlctCompTotalCsc[endc][idh]->GetNbinsX();
3607  for (Int_t ibin = 1; ibin <= nbins; ibin++) {
3608  if (hAlctCompTotalCsc[endc][idh]->GetBinContent(ibin) == 0) {
3609  hAlctMatchEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3610  hAlctMatchEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3611  }
3612  }
3613  gPad->Update();
3614  gStyle->SetStatX(0.65);
3615  hAlctMatchEffVsCsc[endc][idh]->SetMinimum(-0.05);
3616  hAlctMatchEffVsCsc[endc][idh]->SetMaximum(1.05);
3617  hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3618  hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3619  hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3620  hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3621  hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3622  hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3623  hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitle("CSC id");
3624  hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitle("% of exact match");
3625  pad[page]->cd(idh + 1);
3626  hAlctMatchEffVsCsc[endc][idh]->Draw("e");
3627  double numer = hAlctCompMatchCsc[endc][idh]->Integral();
3628  double denom = hAlctCompTotalCsc[endc][idh]->Integral();
3629  double ratio = 0.0, error = 0.0;
3630  if (denom > 0.) {
3631  ratio = numer / denom;
3632  error = sqrt(ratio * (1. - ratio) / denom);
3633  }
3634  sprintf(eff, "eff = (%4.1f +/- %4.1f)%%", ratio * 100., error * 100.);
3635  teff.DrawTextNDC(0.3, 0.5, eff);
3636  }
3637  page++;
3638  c1->Update();
3639  }
3640 
3641  for (int endc = 0; endc < MAX_ENDCAPS; endc++) {
3642  ps->NewPage();
3643  c1->Clear();
3644  c1->cd(0);
3645  sprintf(titl, "CLCT firmware-emulator: match in number found, endcap %d", endc + 1);
3646  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3647  title->SetFillColor(10);
3648  title->Draw();
3649  sprintf(pagenum, "- %d -", page);
3650  t.DrawText(0.9, 0.02, pagenum);
3651  //gStyle->SetOptStat(110010);
3652  gStyle->SetOptStat(0);
3653  pad[page]->Draw();
3654  pad[page]->Divide(2, 5);
3655  TH1F* hClctFoundEffVsCsc[MAX_ENDCAPS][CSC_TYPES];
3656  for (int idh = 0; idh < max_idh; idh++) {
3657  if (!plotME1A && idh == 3)
3658  continue;
3659  hClctFoundEffVsCsc[endc][idh] = (TH1F*)hClctCompFoundCsc[endc][idh]->Clone();
3660  hClctFoundEffVsCsc[endc][idh]->Divide(hClctCompSameNCsc[endc][idh], hClctCompFoundCsc[endc][idh], 1., 1., "B");
3661  nbins = hClctCompFoundCsc[endc][idh]->GetNbinsX();
3662  for (Int_t ibin = 1; ibin <= nbins; ibin++) {
3663  if (hClctCompFoundCsc[endc][idh]->GetBinContent(ibin) == 0) {
3664  hClctFoundEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3665  hClctFoundEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3666  }
3667  }
3668  gPad->Update();
3669  gStyle->SetStatX(0.65);
3670  hClctFoundEffVsCsc[endc][idh]->SetMinimum(-0.05);
3671  hClctFoundEffVsCsc[endc][idh]->SetMaximum(1.05);
3672  hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3673  hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3674  hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3675  hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3676  hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3677  hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3678  hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitle("CSC id");
3679  hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitle("% of same number found");
3680  pad[page]->cd(idh + 1);
3681  hClctFoundEffVsCsc[endc][idh]->Draw("e");
3682  double numer = hClctCompSameNCsc[endc][idh]->Integral();
3683  double denom = hClctCompFoundCsc[endc][idh]->Integral();
3684  double ratio = 0.0, error = 0.0;
3685  if (denom > 0.) {
3686  ratio = numer / denom;
3687  error = sqrt(ratio * (1. - ratio) / denom);
3688  }
3689  sprintf(eff, "eff = (%4.1f +/- %4.1f)%%", ratio * 100., error * 100.);
3690  teff.DrawTextNDC(0.3, 0.5, eff);
3691  }
3692  page++;
3693  c1->Update();
3694  }
3695 
3696  for (int endc = 0; endc < MAX_ENDCAPS; endc++) {
3697  ps->NewPage();
3698  c1->Clear();
3699  c1->cd(0);
3700  sprintf(titl, "CLCT firmware-emulator: exact match, endcap %d", endc + 1);
3701  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3702  title->SetFillColor(10);
3703  title->Draw();
3704  sprintf(pagenum, "- %d -", page);
3705  t.DrawText(0.9, 0.02, pagenum);
3706  //gStyle->SetOptStat(110010);
3707  gStyle->SetOptStat(0);
3708  pad[page]->Draw();
3709  pad[page]->Divide(2, 5);
3710  TH1F* hClctMatchEffVsCsc[MAX_ENDCAPS][CSC_TYPES];
3711  for (int idh = 0; idh < max_idh; idh++) {
3712  if (!plotME1A && idh == 3)
3713  continue;
3714  hClctMatchEffVsCsc[endc][idh] = (TH1F*)hClctCompTotalCsc[endc][idh]->Clone();
3715  hClctMatchEffVsCsc[endc][idh]->Divide(hClctCompMatchCsc[endc][idh], hClctCompTotalCsc[endc][idh], 1., 1., "B");
3716  nbins = hClctCompTotalCsc[endc][idh]->GetNbinsX();
3717  for (Int_t ibin = 1; ibin <= nbins; ibin++) {
3718  if (hClctCompTotalCsc[endc][idh]->GetBinContent(ibin) == 0) {
3719  hClctMatchEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3720  hClctMatchEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3721  }
3722  }
3723  gPad->Update();
3724  gStyle->SetStatX(0.65);
3725  hClctMatchEffVsCsc[endc][idh]->SetMinimum(-0.05);
3726  hClctMatchEffVsCsc[endc][idh]->SetMaximum(1.05);
3727  hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3728  hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3729  hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3730  hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3731  hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3732  hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3733  hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitle("CSC id");
3734  hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitle("% of exact match");
3735  pad[page]->cd(idh + 1);
3736  hClctMatchEffVsCsc[endc][idh]->Draw("e");
3737  double numer = hClctCompMatchCsc[endc][idh]->Integral();
3738  double denom = hClctCompTotalCsc[endc][idh]->Integral();
3739  double ratio = 0.0, error = 0.0;
3740  if (denom > 0.) {
3741  ratio = numer / denom;
3742  error = sqrt(ratio * (1. - ratio) / denom);
3743  }
3744  sprintf(eff, "eff = (%4.1f +/- %4.1f)%%", ratio * 100., error * 100.);
3745  teff.DrawTextNDC(0.3, 0.5, eff);
3746  }
3747  page++;
3748  c1->Update();
3749  }
3750 
3751  for (int endc = 0; endc < MAX_ENDCAPS; endc++) {
3752  ps->NewPage();
3753  c1->Clear();
3754  c1->cd(0);
3755  sprintf(titl, "LCT firmware-emulator: match in number found, endcap %d", endc + 1);
3756  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3757  title->SetFillColor(10);
3758  title->Draw();
3759  sprintf(pagenum, "- %d -", page);
3760  t.DrawText(0.9, 0.02, pagenum);
3761  //gStyle->SetOptStat(110010);
3762  gStyle->SetOptStat(0);
3763  pad[page]->Draw();
3764  pad[page]->Divide(2, 5);
3765  TH1F* hLctFoundEffVsCsc[MAX_ENDCAPS][CSC_TYPES];
3766  for (int idh = 0; idh < max_idh; idh++) {
3767  if (!plotME1A && idh == 3)
3768  continue;
3769  hLctFoundEffVsCsc[endc][idh] = (TH1F*)hLctCompFoundCsc[endc][idh]->Clone();
3770  hLctFoundEffVsCsc[endc][idh]->Divide(hLctCompSameNCsc[endc][idh], hLctCompFoundCsc[endc][idh], 1., 1., "B");
3771  nbins = hLctCompFoundCsc[endc][idh]->GetNbinsX();
3772  for (Int_t ibin = 1; ibin <= nbins; ibin++) {
3773  if (hLctCompFoundCsc[endc][idh]->GetBinContent(ibin) == 0) {
3774  hLctFoundEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3775  hLctFoundEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3776  }
3777  }
3778  gPad->Update();
3779  gStyle->SetStatX(0.65);
3780  hLctFoundEffVsCsc[endc][idh]->SetMinimum(-0.05);
3781  hLctFoundEffVsCsc[endc][idh]->SetMaximum(1.05);
3782  hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3783  hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3784  hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3785  hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3786  hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3787  hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3788  hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitle("CSC id");
3789  hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitle("% of same number found");
3790  pad[page]->cd(idh + 1);
3791  hLctFoundEffVsCsc[endc][idh]->Draw("e");
3792  double numer = hLctCompSameNCsc[endc][idh]->Integral();
3793  double denom = hLctCompFoundCsc[endc][idh]->Integral();
3794  double ratio = 0.0, error = 0.0;
3795  if (denom > 0.) {
3796  ratio = numer / denom;
3797  error = sqrt(ratio * (1. - ratio) / denom);
3798  }
3799  sprintf(eff, "eff = (%4.1f +/- %4.1f)%%", ratio * 100., error * 100.);
3800  teff.DrawTextNDC(0.3, 0.5, eff);
3801  }
3802  page++;
3803  c1->Update();
3804  }
3805 
3806  for (int endc = 0; endc < MAX_ENDCAPS; endc++) {
3807  ps->NewPage();
3808  c1->Clear();
3809  c1->cd(0);
3810  sprintf(titl, "LCT firmware-emulator: exact match, endcap %d", endc + 1);
3811  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3812  title->SetFillColor(10);
3813  title->Draw();
3814  sprintf(pagenum, "- %d -", page);
3815  t.DrawText(0.9, 0.02, pagenum);
3816  //gStyle->SetOptStat(110010);
3817  gStyle->SetOptStat(0);
3818  pad[page]->Draw();
3819  pad[page]->Divide(2, 5);
3820  TH1F* hLctMatchEffVsCsc[MAX_ENDCAPS][CSC_TYPES];
3821  for (int idh = 0; idh < max_idh; idh++) {
3822  if (!plotME1A && idh == 3)
3823  continue;
3824  hLctMatchEffVsCsc[endc][idh] = (TH1F*)hLctCompTotalCsc[endc][idh]->Clone();
3825  hLctMatchEffVsCsc[endc][idh]->Divide(hLctCompMatchCsc[endc][idh], hLctCompTotalCsc[endc][idh], 1., 1., "B");
3826  nbins = hLctCompTotalCsc[endc][idh]->GetNbinsX();
3827  for (Int_t ibin = 1; ibin <= nbins; ibin++) {
3828  if (hLctCompTotalCsc[endc][idh]->GetBinContent(ibin) == 0) {
3829  hLctMatchEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3830  hLctMatchEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3831  }
3832  }
3833  gPad->Update();
3834  gStyle->SetStatX(0.65);
3835  hLctMatchEffVsCsc[endc][idh]->SetMinimum(-0.05);
3836  hLctMatchEffVsCsc[endc][idh]->SetMaximum(1.05);
3837  hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3838  hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3839  hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3840  hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3841  hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3842  hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3843  hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitle("CSC id");
3844  hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitle("% of exact match");
3845  pad[page]->cd(idh + 1);
3846  hLctMatchEffVsCsc[endc][idh]->Draw("e");
3847  double numer = hLctCompMatchCsc[endc][idh]->Integral();
3848  double denom = hLctCompTotalCsc[endc][idh]->Integral();
3849  double ratio = 0.0, error = 0.0;
3850  if (denom > 0.) {
3851  ratio = numer / denom;
3852  error = sqrt(ratio * (1. - ratio) / denom);
3853  }
3854  sprintf(eff, "eff = (%4.1f +/- %4.1f)%%", ratio * 100., error * 100.);
3855  teff.DrawTextNDC(0.3, 0.5, eff);
3856  }
3857  page++;
3858  c1->Update();
3859  }
3860 
3861  ps->Close();
3862  delete c1;
3863 }
TH1F * hClctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hLctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hClctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hAlctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hAlctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hClctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hAlctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
T sqrt(T t)
Definition: SSEVec.h:19
TH1F * hLctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hLctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
string fname
main script
TH1F * hAlctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hClctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
TH1F * hLctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
void CSCTriggerPrimitivesReader::drawEfficHistos ( )
private

Definition at line 4253 of file CSCTriggerPrimitivesReader.cc.

References alignmentValidation::c1, csc_type, CSC_TYPES, alignmentValidation::fname, hEfficALCTEta, hEfficALCTEtaCsc, hEfficCLCTEta, hEfficCLCTEtaCsc, hEfficHitsEta, hEfficHitsEtaCsc, MAX_STATIONS, MAXPAGES, MainPageGenerator::page, plotME1A, plotME42, resultsFileNamesPrefix_, OrderedSet::t, and overlapproblemtsosanalyzer_cfi::title.

Referenced by endJob().

4253  {
4254  TCanvas* c1 = new TCanvas("c1", "", 0, 0, 500, 700);
4255  string fname = resultsFileNamesPrefix_ + "lcts_effic.ps";
4256  TPostScript* ps = new TPostScript(fname.c_str(), 111);
4257 
4258  TPad* pad[MAXPAGES];
4259  for (int i_page = 0; i_page < MAXPAGES; i_page++) {
4260  pad[i_page] = new TPad("", "", .05, .05, .93, .93);
4261  }
4262 
4263  int page = 1;
4264  TText t;
4265  t.SetTextFont(32);
4266  t.SetTextSize(0.025);
4267  char pagenum[7];
4268  TPaveLabel* title;
4269  char histtitle[60];
4270 
4271  gStyle->SetOptDate(0);
4272  gStyle->SetTitleSize(0.1, ""); // size for pad title; default is 0.02
4273 
4274  int max_idh = plotME42 ? CSC_TYPES : CSC_TYPES - 1;
4275 
4276  ps->NewPage();
4277  c1->Clear();
4278  c1->cd(0);
4279  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "ALCT efficiency vs #eta");
4280  title->SetFillColor(10);
4281  title->Draw();
4282  sprintf(pagenum, "- %d -", page);
4283  t.DrawText(0.9, 0.02, pagenum);
4284  gStyle->SetOptStat(0);
4285  pad[page]->Draw();
4286  pad[page]->Divide(2, 2);
4287  TH1F* hALCTEffVsEta[MAX_STATIONS];
4288  for (int istation = 0; istation < MAX_STATIONS; istation++) {
4289  hALCTEffVsEta[istation] = (TH1F*)hEfficHitsEta[istation]->Clone();
4290  hALCTEffVsEta[istation]->Divide(hEfficALCTEta[istation], hEfficHitsEta[istation], 1., 1., "B");
4291  hALCTEffVsEta[istation]->GetXaxis()->SetTitleOffset(1.2);
4292  hALCTEffVsEta[istation]->GetXaxis()->SetTitle("#eta");
4293  hALCTEffVsEta[istation]->SetMaximum(1.05);
4294  sprintf(histtitle, "ALCT efficiency vs #eta, station %d", istation + 1);
4295  hALCTEffVsEta[istation]->SetTitle(histtitle);
4296  pad[page]->cd(istation + 1);
4297  hALCTEffVsEta[istation]->Draw();
4298  }
4299  page++;
4300  c1->Update();
4301 
4302  c1->Clear();
4303  c1->cd(0);
4304  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "ALCT efficiency vs #eta");
4305  title->SetFillColor(10);
4306  title->Draw();
4307  sprintf(pagenum, "- %d -", page);
4308  t.DrawText(0.9, 0.02, pagenum);
4309  gStyle->SetOptStat(11111);
4310  pad[page]->Draw();
4311  pad[page]->Divide(2, 5);
4312  TH1F* hALCTEffVsEtaCsc[CSC_TYPES];
4313  for (int idh = 0; idh < max_idh; idh++) {
4314  if (!plotME1A && idh == 3)
4315  continue;
4316  hALCTEffVsEtaCsc[idh] = (TH1F*)hEfficHitsEtaCsc[idh]->Clone();
4317  hALCTEffVsEtaCsc[idh]->Divide(hEfficALCTEtaCsc[idh], hEfficHitsEtaCsc[idh], 1., 1., "B");
4318  if (idh == 3 || idh == 4 || idh == 6 || idh == 8) {
4319  gPad->Update();
4320  gStyle->SetStatX(0.43);
4321  } else {
4322  gPad->Update();
4323  gStyle->SetStatX(1.00);
4324  }
4325  hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle("#eta");
4326  hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4327  hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07); // default=0.05
4328  hALCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10); // default=0.04
4329  hALCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4330  hALCTEffVsEtaCsc[idh]->SetLabelOffset(0.012, "XY");
4331  hALCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4332  hALCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4333  hALCTEffVsEtaCsc[idh]->SetTitle(csc_type[idh].c_str());
4334  hALCTEffVsEtaCsc[idh]->SetTitleSize(0.1, "");
4335  hALCTEffVsEtaCsc[idh]->SetLineWidth(2);
4336  hALCTEffVsEtaCsc[idh]->SetLineColor(4);
4337  pad[page]->cd(idh + 1);
4338  gPad->SetGrid(1);
4339  hALCTEffVsEtaCsc[idh]->Draw();
4340  }
4341  page++;
4342  c1->Update();
4343 
4344  ps->NewPage();
4345  c1->Clear();
4346  c1->cd(0);
4347  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "CLCT efficiency vs #eta");
4348  title->SetFillColor(10);
4349  title->Draw();
4350  sprintf(pagenum, "- %d -", page);
4351  t.DrawText(0.9, 0.02, pagenum);
4352  gStyle->SetOptStat(0);
4353  pad[page]->Draw();
4354  pad[page]->Divide(2, 2);
4355  TH1F* hCLCTEffVsEta[MAX_STATIONS];
4356  for (int istation = 0; istation < MAX_STATIONS; istation++) {
4357  hCLCTEffVsEta[istation] = (TH1F*)hEfficHitsEta[istation]->Clone();
4358  hCLCTEffVsEta[istation]->Divide(hEfficCLCTEta[istation], hEfficHitsEta[istation], 1., 1., "B");
4359  hCLCTEffVsEta[istation]->GetXaxis()->SetTitleOffset(1.2);
4360  hCLCTEffVsEta[istation]->GetXaxis()->SetTitle("#eta");
4361  hCLCTEffVsEta[istation]->SetMaximum(1.05);
4362  sprintf(histtitle, "CLCT efficiency vs #eta, station %d", istation + 1);
4363  hCLCTEffVsEta[istation]->SetTitle(histtitle);
4364  pad[page]->cd(istation + 1);
4365  hCLCTEffVsEta[istation]->Draw();
4366  }
4367  page++;
4368  c1->Update();
4369 
4370  c1->Clear();
4371  c1->cd(0);
4372  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "CLCT efficiency vs #eta");
4373  title->SetFillColor(10);
4374  title->Draw();
4375  sprintf(pagenum, "- %d -", page);
4376  t.DrawText(0.9, 0.02, pagenum);
4377  gStyle->SetOptStat(111110);
4378  pad[page]->Draw();
4379  pad[page]->Divide(2, 5);
4380  TH1F* hCLCTEffVsEtaCsc[CSC_TYPES];
4381  for (int idh = 0; idh < max_idh; idh++) {
4382  if (!plotME1A && idh == 3)
4383  continue;
4384  hCLCTEffVsEtaCsc[idh] = (TH1F*)hEfficHitsEtaCsc[idh]->Clone();
4385  hCLCTEffVsEtaCsc[idh]->Divide(hEfficCLCTEtaCsc[idh], hEfficHitsEtaCsc[idh], 1., 1., "B");
4386  if (idh == 3 || idh == 4 || idh == 6 || idh == 8) {
4387  gPad->Update();
4388  gStyle->SetStatX(0.43);
4389  } else {
4390  gPad->Update();
4391  gStyle->SetStatX(1.00);
4392  }
4393  hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle("#eta");
4394  hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4395  hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07); // default=0.05
4396  hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10); // default=0.04
4397  hCLCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4398  hCLCTEffVsEtaCsc[idh]->SetLabelOffset(0.012, "XY");
4399  hCLCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4400  hCLCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4401  hCLCTEffVsEtaCsc[idh]->SetTitle(csc_type[idh].c_str());
4402  hCLCTEffVsEtaCsc[idh]->SetLineWidth(2);
4403  hCLCTEffVsEtaCsc[idh]->SetLineColor(4);
4404  pad[page]->cd(idh + 1);
4405  gPad->SetGrid(1);
4406  hCLCTEffVsEtaCsc[idh]->Draw();
4407  }
4408  page++;
4409  c1->Update();
4410 
4411  ps->Close();
4412  delete c1;
4413 }
static const std::string csc_type[CSC_TYPES]
string fname
main script
void CSCTriggerPrimitivesReader::drawHistosForTalks ( )
private

Definition at line 4415 of file CSCTriggerPrimitivesReader.cc.

References bookedEfficHistos, bookedResolHistos, alignmentValidation::c1, csc_type, CSC_TYPES, hClctCFEB, hClctKeyStrip, hClctPattern, hClctQuality, hClctSign, hClctStripType, hEfficALCTEtaCsc, hEfficCLCTEtaCsc, hEfficHitsEtaCsc, hPhiDiffCsc, hResolDeltaDS, hResolDeltaHS, hResolDeltaWG, MAXPAGES, MainPageGenerator::page, plotME1A, plotME42, and overlapproblemtsosanalyzer_cfi::title.

4415  {
4416  TCanvas* c1 = new TCanvas("c1", "", 0, 0, 500, 640);
4417  TCanvas* c2 = new TCanvas("c2", "", 0, 0, 540, 540);
4418 
4419  TPad* pad[MAXPAGES];
4420  for (int i_page = 0; i_page < MAXPAGES; i_page++) {
4421  pad[i_page] = new TPad("", "", .07, .07, .93, .93);
4422  }
4423 
4424  int page = 1;
4425  TPaveLabel* title;
4426  gStyle->SetOptDate(0);
4427 
4428  int max_idh = plotME42 ? CSC_TYPES : CSC_TYPES - 1;
4429 
4430  TPostScript* eps1 = new TPostScript("clcts.eps", 113);
4431  eps1->NewPage();
4432  c1->Clear();
4433  c1->cd(0);
4434  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "CLCT quantities");
4435  title->SetFillColor(10);
4436  title->Draw();
4437  pad[page]->Draw();
4438  pad[page]->Divide(2, 3);
4439  pad[page]->cd(1);
4440  hClctQuality->Draw();
4441  pad[page]->cd(2);
4442  hClctSign->Draw();
4443  TH1F* hClctPatternTot = (TH1F*)hClctPattern[0]->Clone();
4444  hClctPatternTot->SetTitle("CLCT pattern #");
4445  hClctPatternTot->Add(hClctPattern[0], hClctPattern[1], 1., 1.);
4446  pad[page]->cd(3);
4447  hClctPatternTot->Draw();
4448  hClctPattern[0]->SetLineStyle(2);
4449  hClctPattern[0]->Draw("same");
4450  hClctPattern[1]->SetLineStyle(3);
4451  hClctPattern[1]->Draw("same");
4452  pad[page]->cd(4);
4453  hClctCFEB->Draw();
4454  pad[page]->cd(5);
4455  hClctStripType->Draw();
4456  TH1F* hClctKeyStripTot = (TH1F*)hClctKeyStrip[0]->Clone();
4457  hClctKeyStripTot->SetTitle("CLCT key strip #");
4458  hClctKeyStripTot->Add(hClctKeyStrip[0], hClctKeyStrip[1], 1., 1.);
4459  pad[page]->cd(6);
4460  hClctKeyStripTot->Draw();
4461  page++;
4462  c1->Update();
4463  c1->Print("asdf.png");
4464  eps1->Close();
4465 
4466  // Resolution histograms.
4467  if (bookedResolHistos) {
4468  gStyle->SetTitleSize(0.055, ""); // size for pad title; default is 0.02
4469 
4470  TPostScript* eps2 = new TPostScript("alct_deltaWG.eps", 113);
4471  eps2->NewPage();
4472  c2->Clear();
4473  c2->cd(0);
4474  gStyle->SetOptStat(0);
4475  pad[page]->Draw();
4476  pad[page]->Divide(1, 1);
4477  hResolDeltaWG->GetXaxis()->SetTitle("WG_{rec} - WG_{sim}");
4478  hResolDeltaWG->GetXaxis()->SetTitleOffset(1.2);
4479  hResolDeltaWG->GetYaxis()->SetTitle("Entries");
4480  hResolDeltaWG->GetYaxis()->SetTitleOffset(1.9);
4481  hResolDeltaWG->GetXaxis()->SetLabelSize(0.04);
4482  hResolDeltaWG->GetYaxis()->SetLabelSize(0.04);
4483  pad[page]->cd(1);
4484  hResolDeltaWG->Draw();
4485  page++;
4486  c2->Update();
4487  eps2->Close();
4488 
4489  TPostScript* eps3 = new TPostScript("clct_deltaHS.eps", 113);
4490  eps3->NewPage();
4491  c2->Clear();
4492  c2->cd(0);
4493  pad[page]->Draw();
4494  pad[page]->Divide(1, 1);
4495  hResolDeltaHS->GetXaxis()->SetTitle("HS_{rec} - HS_{sim}");
4496  hResolDeltaHS->GetXaxis()->SetTitleOffset(1.2);
4497  hResolDeltaHS->GetYaxis()->SetTitle("Entries");
4498  hResolDeltaHS->GetYaxis()->SetTitleOffset(1.7);
4499  hResolDeltaHS->GetXaxis()->SetLabelSize(0.04); // default=0.04
4500  hResolDeltaHS->GetYaxis()->SetLabelSize(0.04);
4501  pad[page]->cd(1);
4502  hResolDeltaHS->Draw();
4503  page++;
4504  c2->Update();
4505  eps3->Close();
4506 
4507  TPostScript* eps4 = new TPostScript("clct_deltaDS.eps", 113);
4508  eps4->NewPage();
4509  c2->Clear();
4510  c2->cd(0);
4511  gStyle->SetOptStat(0);
4512  pad[page]->Draw();
4513  pad[page]->Divide(1, 1);
4514  hResolDeltaDS->GetXaxis()->SetTitle("DS_{rec} - DS_{sim}");
4515  hResolDeltaDS->GetXaxis()->SetTitleOffset(1.2);
4516  hResolDeltaDS->GetYaxis()->SetTitle("Entries");
4517  hResolDeltaDS->GetYaxis()->SetTitleOffset(1.6);
4518  hResolDeltaDS->GetXaxis()->SetLabelSize(0.04); // default=0.04
4519  hResolDeltaDS->GetYaxis()->SetLabelSize(0.04);
4520  pad[page]->cd(1);
4521  hResolDeltaDS->Draw();
4522  page++;
4523  c2->Update();
4524  eps4->Close();
4525 
4526  TPostScript* eps5 = new TPostScript("clct_deltaPhi_hs.eps", 113);
4527  eps5->NewPage();
4528  c1->Clear();
4529  c1->cd(0);
4530  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#phi_rec-#phi_sim (mrad), halfstrips only");
4531  title->SetFillColor(10);
4532  title->Draw();
4533  gStyle->SetTitleSize(0.1, ""); // size for pad title; default is 0.02
4534  gStyle->SetOptStat(111110);
4535  pad[page]->Draw();
4536  pad[page]->Divide(2, 5);
4537  for (int idh = 0; idh < max_idh; idh++) {
4538  if (!plotME1A && idh == 3)
4539  continue;
4540  pad[page]->cd(idh + 1);
4541  hPhiDiffCsc[idh][4]->Draw();
4542  //if (hPhiDiffCsc[idh][4]->GetEntries() > 1)
4543  //hPhiDiffCsc[idh][4]->Fit("gaus","Q");
4544  //hPhiDiffCsc[idh][4]->GetXaxis()->SetTitle("#phi_{rec} - #phi_{sim} (mrad)");
4545  //hPhiDiffCsc[idh][4]->GetXaxis()->SetTitleSize(0.06);
4546  //hPhiDiffCsc[idh][4]->GetXaxis()->SetTitleOffset(0.9);
4547  hPhiDiffCsc[idh][4]->GetYaxis()->SetTitle("Entries ");
4548  hPhiDiffCsc[idh][4]->GetYaxis()->SetTitleSize(0.07);
4549  hPhiDiffCsc[idh][4]->GetYaxis()->SetTitleOffset(1.0);
4550  hPhiDiffCsc[idh][4]->GetXaxis()->SetLabelSize(0.10); // default=0.04
4551  hPhiDiffCsc[idh][4]->GetYaxis()->SetLabelSize(0.10);
4552  hPhiDiffCsc[idh][4]->SetLabelOffset(0.012, "XY");
4553  }
4554  page++;
4555  c1->Update();
4556  eps5->Close();
4557  }
4558 
4559  // Efficiency histograms.
4560  if (bookedEfficHistos) {
4561  TPostScript* eps6 = new TPostScript("alct_effic.eps", 113);
4562  eps6->NewPage();
4563  c1->Clear();
4564  c1->cd(0);
4565  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "ALCT efficiency vs #eta");
4566  title->SetFillColor(10);
4567  title->Draw();
4568  gStyle->SetOptStat(0);
4569  pad[page]->Draw();
4570  pad[page]->Divide(2, 5);
4571  TH1F* hALCTEffVsEtaCsc[CSC_TYPES];
4572  for (int idh = 0; idh < max_idh; idh++) {
4573  if (!plotME1A && idh == 3)
4574  continue;
4575  hALCTEffVsEtaCsc[idh] = (TH1F*)hEfficHitsEtaCsc[idh]->Clone();
4576  hALCTEffVsEtaCsc[idh]->Divide(hEfficALCTEtaCsc[idh], hEfficHitsEtaCsc[idh], 1., 1., "B");
4577  hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle("#eta");
4578  hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4579  hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07); // default=0.05
4580  hALCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10); // default=0.04
4581  hALCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4582  hALCTEffVsEtaCsc[idh]->SetLabelOffset(0.012, "XY");
4583  hALCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4584  hALCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4585  hALCTEffVsEtaCsc[idh]->SetTitle(csc_type[idh].c_str());
4586  hALCTEffVsEtaCsc[idh]->SetTitleSize(0.1, "");
4587  hALCTEffVsEtaCsc[idh]->SetLineWidth(2);
4588  hALCTEffVsEtaCsc[idh]->SetLineColor(4);
4589  hALCTEffVsEtaCsc[idh]->SetLineColor(4);
4590  pad[page]->cd(idh + 1);
4591  gPad->SetGrid(1);
4592  hALCTEffVsEtaCsc[idh]->Draw();
4593  }
4594  page++;
4595  c1->Update();
4596  eps6->Close();
4597 
4598  TPostScript* eps7 = new TPostScript("clct_effic.eps", 113);
4599  eps7->NewPage();
4600  c1->Clear();
4601  c1->cd(0);
4602  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "CLCT efficiency vs #eta");
4603  title->SetFillColor(10);
4604  title->Draw();
4605  gStyle->SetOptStat(0);
4606  pad[page]->Draw();
4607  pad[page]->Divide(2, 5);
4608  TH1F* hCLCTEffVsEtaCsc[CSC_TYPES];
4609  for (int idh = 0; idh < max_idh; idh++) {
4610  if (!plotME1A && idh == 3)
4611  continue;
4612  hCLCTEffVsEtaCsc[idh] = (TH1F*)hEfficHitsEtaCsc[idh]->Clone();
4613  hCLCTEffVsEtaCsc[idh]->Divide(hEfficCLCTEtaCsc[idh], hEfficHitsEtaCsc[idh], 1., 1., "B");
4614  hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle("#eta");
4615  hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4616  hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07); // default=0.05
4617  hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10); // default=0.04
4618  hCLCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4619  hCLCTEffVsEtaCsc[idh]->SetLabelOffset(0.012, "XY");
4620  hCLCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4621  hCLCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4622  hCLCTEffVsEtaCsc[idh]->SetTitle(csc_type[idh].c_str());
4623  hCLCTEffVsEtaCsc[idh]->SetLineWidth(2);
4624  hCLCTEffVsEtaCsc[idh]->SetLineColor(4);
4625  pad[page]->cd(idh + 1);
4626  gPad->SetGrid(1);
4627  hCLCTEffVsEtaCsc[idh]->Draw();
4628  }
4629  page++;
4630  c1->Update();
4631  eps7->Close();
4632  }
4633  delete c1;
4634  delete c2;
4635 }
static const std::string csc_type[CSC_TYPES]
void CSCTriggerPrimitivesReader::drawLCTMPCHistos ( )
private

Definition at line 3405 of file CSCTriggerPrimitivesReader.cc.

References alignmentValidation::c1, csc_type, CSC_TYPES, alignmentValidation::fname, hCorrLctMPCPerCSC, hLctMPCBend, hLctMPCBXN, hLctMPCChamber, hLctMPCEndcap, hLctMPCKeyGroup, hLctMPCKeyStrip, hLctMPCPattern, hLctMPCPerCSC, hLctMPCPerEvent, hLctMPCQuality, hLctMPCRing, hLctMPCSector, hLctMPCStation, hLctMPCStripType, hLctMPCValid, mps_fire::i, MAX_STATIONS, MAXPAGES, MainPageGenerator::page, resultsFileNamesPrefix_, OrderedSet::t, and overlapproblemtsosanalyzer_cfi::title.

3405  {
3406  TCanvas* c1 = new TCanvas("c1", "", 0, 0, 500, 640);
3407  string fname = resultsFileNamesPrefix_ + "lcts_mpc.ps";
3408  TPostScript* ps = new TPostScript(fname.c_str(), 111);
3409 
3410  TPad* pad[MAXPAGES];
3411  for (int i_page = 0; i_page < MAXPAGES; i_page++) {
3412  pad[i_page] = new TPad("", "", .05, .05, .93, .93);
3413  }
3414 
3415  int page = 1;
3416  TText t;
3417  t.SetTextFont(32);
3418  t.SetTextSize(0.025);
3419  char pagenum[7];
3420  TPaveLabel* title;
3421 
3422  ps->NewPage();
3423  c1->Clear();
3424  c1->cd(0);
3425  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "Number of LCTs");
3426  title->SetFillColor(10);
3427  title->Draw();
3428  sprintf(pagenum, "- %d -", page);
3429  t.DrawText(0.9, 0.02, pagenum);
3430  gStyle->SetOptStat(111110);
3431  pad[page]->Draw();
3432  pad[page]->Divide(1, 3);
3433  pad[page]->cd(1);
3434  hLctMPCPerEvent->Draw();
3435  for (int i = 0; i < CSC_TYPES; i++) {
3436  hLctMPCPerCSC->GetXaxis()->SetBinLabel(i + 1, csc_type[i].c_str());
3437  hCorrLctMPCPerCSC->GetXaxis()->SetBinLabel(i + 1, csc_type[i].c_str());
3438  }
3439  // Should be multiplied by 40/nevents to convert to MHz
3440  pad[page]->cd(2);
3441  hLctMPCPerCSC->Draw();
3442  pad[page]->cd(3);
3443  hCorrLctMPCPerCSC->Draw();
3444  page++;
3445  c1->Update();
3446 
3447  ps->NewPage();
3448  c1->Clear();
3449  c1->cd(0);
3450  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "LCT geometry");
3451  title->SetFillColor(10);
3452  title->Draw();
3453  sprintf(pagenum, "- %d -", page);
3454  t.DrawText(0.9, 0.02, pagenum);
3455  gStyle->SetOptStat(110110);
3456  pad[page]->Draw();
3457  pad[page]->Divide(2, 4);
3458  pad[page]->cd(1);
3459  hLctMPCEndcap->Draw();
3460  pad[page]->cd(2);
3461  hLctMPCStation->Draw();
3462  pad[page]->cd(3);
3463  hLctMPCSector->Draw();
3464  pad[page]->cd(4);
3465  hLctMPCRing->Draw();
3466  for (int istat = 0; istat < MAX_STATIONS; istat++) {
3467  pad[page]->cd(istat + 5);
3468  hLctMPCChamber[istat]->Draw();
3469  }
3470  page++;
3471  c1->Update();
3472 
3473  ps->NewPage();
3474  c1->Clear();
3475  c1->cd(0);
3476  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "LCT quantities");
3477  title->SetFillColor(10);
3478  title->Draw();
3479  sprintf(pagenum, "- %d -", page);
3480  t.DrawText(0.9, 0.02, pagenum);
3481  pad[page]->Draw();
3482  pad[page]->Divide(2, 4);
3483  pad[page]->cd(1);
3484  hLctMPCValid->Draw();
3485  pad[page]->cd(2);
3486  hLctMPCQuality->Draw();
3487  pad[page]->cd(3);
3488  hLctMPCKeyGroup->Draw();
3489  pad[page]->cd(4);
3490  hLctMPCKeyStrip->Draw();
3491  pad[page]->cd(5);
3492  hLctMPCStripType->Draw();
3493  pad[page]->cd(6);
3494  hLctMPCPattern->Draw();
3495  pad[page]->cd(7);
3496  hLctMPCBend->Draw();
3497  pad[page]->cd(8);
3498  hLctMPCBXN->Draw();
3499  page++;
3500  c1->Update();
3501 
3502  ps->Close();
3503  delete c1;
3504 }
static const std::string csc_type[CSC_TYPES]
string fname
main script
void CSCTriggerPrimitivesReader::drawLCTTMBHistos ( )
private

Definition at line 3273 of file CSCTriggerPrimitivesReader.cc.

References alignmentValidation::c1, csc_type, CSC_TYPES, alignmentValidation::fname, hCorrLctTMBPerCSC, hLctTMBBend, hLctTMBBXN, hLctTMBChamber, hLctTMBCsc, hLctTMBEndcap, hLctTMBKeyGroup, hLctTMBKeyStrip, hLctTMBPattern, hLctTMBPerChamber, hLctTMBPerCSC, hLctTMBPerEvent, hLctTMBQuality, hLctTMBRing, hLctTMBSector, hLctTMBStation, hLctTMBStripType, hLctTMBValid, mps_fire::i, MAX_ENDCAPS, MAX_STATIONS, MAXPAGES, MainPageGenerator::page, plotME1A, plotME42, resultsFileNamesPrefix_, OrderedSet::t, and overlapproblemtsosanalyzer_cfi::title.

Referenced by endJob().

3273  {
3274  TCanvas* c1 = new TCanvas("c1", "", 0, 0, 500, 640);
3275  string fname = resultsFileNamesPrefix_ + "lcts_tmb.ps";
3276  TPostScript* ps = new TPostScript(fname.c_str(), 111);
3277 
3278  TPad* pad[MAXPAGES];
3279  for (int i_page = 0; i_page < MAXPAGES; i_page++) {
3280  pad[i_page] = new TPad("", "", .05, .05, .93, .93);
3281  }
3282 
3283  int page = 1;
3284  TText t;
3285  t.SetTextFont(32);
3286  t.SetTextSize(0.025);
3287  char pagenum[7], titl[50];
3288  TPaveLabel* title;
3289 
3290  int max_idh = plotME42 ? CSC_TYPES : CSC_TYPES - 1;
3291 
3292  ps->NewPage();
3293  c1->Clear();
3294  c1->cd(0);
3295  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "Number of LCTs");
3296  title->SetFillColor(10);
3297  title->Draw();
3298  sprintf(pagenum, "- %d -", page);
3299  t.DrawText(0.9, 0.02, pagenum);
3300  gStyle->SetOptStat(111110);
3301  pad[page]->Draw();
3302  pad[page]->Divide(2, 2);
3303  pad[page]->cd(1);
3304  hLctTMBPerEvent->Draw();
3305  pad[page]->cd(2);
3306  hLctTMBPerChamber->Draw();
3307  c1->Update();
3308  for (int i = 0; i < CSC_TYPES; i++) {
3309  hLctTMBPerCSC->GetXaxis()->SetBinLabel(i + 1, csc_type[i].c_str());
3310  hCorrLctTMBPerCSC->GetXaxis()->SetBinLabel(i + 1, csc_type[i].c_str());
3311  }
3312  // Should be multiplied by 40/nevents to convert to MHz
3313  pad[page]->cd(3);
3314  hLctTMBPerCSC->Draw();
3315  pad[page]->cd(4);
3316  hCorrLctTMBPerCSC->Draw();
3317  gStyle->SetOptStat(1110);
3318  page++;
3319  c1->Update();
3320 
3321  ps->NewPage();
3322  c1->Clear();
3323  c1->cd(0);
3324  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "LCT geometry");
3325  title->SetFillColor(10);
3326  title->Draw();
3327  sprintf(pagenum, "- %d -", page);
3328  t.DrawText(0.9, 0.02, pagenum);
3329  gStyle->SetOptStat(110110);
3330  pad[page]->Draw();
3331  pad[page]->Divide(2, 4);
3332  pad[page]->cd(1);
3333  hLctTMBEndcap->Draw();
3334  pad[page]->cd(2);
3335  hLctTMBStation->Draw();
3336  pad[page]->cd(3);
3337  hLctTMBSector->Draw();
3338  pad[page]->cd(4);
3339  hLctTMBRing->Draw();
3340  for (int istat = 0; istat < MAX_STATIONS; istat++) {
3341  pad[page]->cd(istat + 5);
3342  hLctTMBChamber[istat]->Draw();
3343  }
3344  page++;
3345  c1->Update();
3346 
3347  for (int endc = 0; endc < MAX_ENDCAPS; endc++) {
3348  ps->NewPage();
3349  c1->Clear();
3350  c1->cd(0);
3351  sprintf(titl, "LCTs per chamber, endcap %d", endc + 1);
3352  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3353  title->SetFillColor(10);
3354  title->Draw();
3355  sprintf(pagenum, "- %d -", page);
3356  t.DrawText(0.9, 0.02, pagenum);
3357  gStyle->SetOptStat(10);
3358  pad[page]->Draw();
3359  pad[page]->Divide(2, 5);
3360  for (int idh = 0; idh < max_idh; idh++) {
3361  if (!plotME1A && idh == 3)
3362  continue;
3363  hLctTMBCsc[endc][idh]->SetMinimum(0.0);
3364  pad[page]->cd(idh + 1);
3365  hLctTMBCsc[endc][idh]->Draw();
3366  }
3367  page++;
3368  c1->Update();
3369  }
3370 
3371  ps->NewPage();
3372  c1->Clear();
3373  c1->cd(0);
3374  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "LCT quantities");
3375  title->SetFillColor(10);
3376  title->Draw();
3377  sprintf(pagenum, "- %d -", page);
3378  t.DrawText(0.9, 0.02, pagenum);
3379  gStyle->SetOptStat(110110);
3380  pad[page]->Draw();
3381  pad[page]->Divide(2, 4);
3382  pad[page]->cd(1);
3383  hLctTMBValid->Draw();
3384  pad[page]->cd(2);
3385  hLctTMBQuality->Draw();
3386  pad[page]->cd(3);
3387  hLctTMBKeyGroup->Draw();
3388  pad[page]->cd(4);
3389  hLctTMBKeyStrip->Draw();
3390  pad[page]->cd(5);
3391  hLctTMBStripType->Draw();
3392  pad[page]->cd(6);
3393  hLctTMBPattern->Draw();
3394  pad[page]->cd(7);
3395  hLctTMBBend->Draw();
3396  pad[page]->cd(8);
3397  hLctTMBBXN->Draw();
3398  page++;
3399  c1->Update();
3400 
3401  ps->Close();
3402  delete c1;
3403 }
static const std::string csc_type[CSC_TYPES]
string fname
main script
TH1F * hLctTMBCsc[MAX_ENDCAPS][CSC_TYPES]
void CSCTriggerPrimitivesReader::drawResolHistos ( )
private

Definition at line 3865 of file CSCTriggerPrimitivesReader.cc.

References alignmentValidation::c1, CSC_TYPES, alignmentValidation::fname, hAlctVsEta, hClctVsPhi, hEtaDiffCsc, hEtaDiffVsEta, hEtaDiffVsWireCsc, hEtaRecVsSim, hPhiDiffCsc, hPhiDiffPattern, hPhiDiffVsPhi, hPhiDiffVsStripCsc, hPhiRecVsSim, hResolDeltaDS, hResolDeltaEta, hResolDeltaHS, hResolDeltaPhi, hResolDeltaWG, hTrueBendCsc, MAX_STATIONS, MAXPAGES, CSCConstants::NUM_CLCT_PATTERNS, MainPageGenerator::page, plotME1A, plotME42, resultsFileNamesPrefix_, OrderedSet::t, and overlapproblemtsosanalyzer_cfi::title.

Referenced by endJob().

3865  {
3866  TCanvas* c1 = new TCanvas("c1", "", 0, 0, 500, 640);
3867  string fname = resultsFileNamesPrefix_ + "lcts_resol.ps";
3868  TPostScript* ps = new TPostScript(fname.c_str(), 111);
3869 
3870  TPad* pad[MAXPAGES];
3871  for (int i_page = 0; i_page < MAXPAGES; i_page++) {
3872  pad[i_page] = new TPad("", "", .05, .05, .93, .93);
3873  }
3874 
3875  int page = 1;
3876  TText t;
3877  t.SetTextFont(32);
3878  t.SetTextSize(0.025);
3879  char pagenum[7];
3880  TPaveLabel* title;
3881 
3882  int max_idh = plotME42 ? CSC_TYPES : CSC_TYPES - 1;
3883 
3884  ps->NewPage();
3885  c1->Clear();
3886  c1->cd(0);
3887  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "ALCT resolution");
3888  title->SetFillColor(10);
3889  title->Draw();
3890  sprintf(pagenum, "- %d -", page);
3891  t.DrawText(0.9, 0.02, pagenum);
3892  gStyle->SetOptStat(111110);
3893  pad[page]->Draw();
3894  pad[page]->Divide(2, 2);
3895  gStyle->SetStatX(1.00);
3896  gStyle->SetStatY(0.65);
3897  pad[page]->cd(1);
3898  hEtaRecVsSim->SetMarkerSize(0.2);
3899  hEtaRecVsSim->Draw();
3900  gPad->Update();
3901  gStyle->SetStatX(1.00);
3902  gStyle->SetStatY(0.995);
3903  hResolDeltaWG->GetXaxis()->SetTitle("WG_{rec} - WG_{sim}");
3904  hResolDeltaWG->GetXaxis()->SetTitleOffset(1.2);
3905  hResolDeltaWG->GetYaxis()->SetTitle("Entries");
3906  hResolDeltaWG->GetYaxis()->SetTitleOffset(1.9);
3907  hResolDeltaWG->GetXaxis()->SetLabelSize(0.03);
3908  hResolDeltaWG->GetYaxis()->SetLabelSize(0.03);
3909  pad[page]->cd(3);
3910  hResolDeltaWG->Draw();
3911  hResolDeltaEta->GetXaxis()->SetNdivisions(505); // twice fewer divisions
3912  hResolDeltaEta->GetXaxis()->SetLabelSize(0.04);
3913  hResolDeltaEta->GetYaxis()->SetLabelSize(0.04);
3914  pad[page]->cd(4);
3915  hResolDeltaEta->Draw();
3916  hResolDeltaEta->Fit("gaus", "Q");
3917  page++;
3918  c1->Update();
3919 
3920  ps->NewPage();
3921  c1->Clear();
3922  c1->cd(0);
3923  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#eta_rec-#eta_sim");
3924  title->SetFillColor(10);
3925  title->Draw();
3926  sprintf(pagenum, "- %d -", page);
3927  t.DrawText(0.9, 0.02, pagenum);
3928  pad[page]->Draw();
3929  pad[page]->Divide(2, 5);
3930  for (int idh = 0; idh < max_idh; idh++) {
3931  if (!plotME1A && idh == 3)
3932  continue;
3933  hEtaDiffCsc[idh][0]->GetXaxis()->SetLabelSize(0.07); // default=0.04
3934  hEtaDiffCsc[idh][0]->GetYaxis()->SetLabelSize(0.07);
3935  pad[page]->cd(idh + 1);
3936  hEtaDiffCsc[idh][0]->Draw();
3937  if (hEtaDiffCsc[idh][0]->GetEntries() > 1)
3938  hEtaDiffCsc[idh][0]->Fit("gaus", "Q");
3939  }
3940  page++;
3941  c1->Update();
3942 
3943  ps->NewPage();
3944  c1->Clear();
3945  c1->cd(0);
3946  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#eta_rec-#eta_sim, endcap1");
3947  title->SetFillColor(10);
3948  title->Draw();
3949  sprintf(pagenum, "- %d -", page);
3950  t.DrawText(0.9, 0.02, pagenum);
3951  pad[page]->Draw();
3952  pad[page]->Divide(2, 5);
3953  for (int idh = 0; idh < max_idh; idh++) {
3954  if (!plotME1A && idh == 3)
3955  continue;
3956  hEtaDiffCsc[idh][1]->GetXaxis()->SetLabelSize(0.07); // default=0.04
3957  hEtaDiffCsc[idh][1]->GetYaxis()->SetLabelSize(0.07);
3958  pad[page]->cd(idh + 1);
3959  hEtaDiffCsc[idh][1]->Draw();
3960  if (hEtaDiffCsc[idh][1]->GetEntries() > 1)
3961  hEtaDiffCsc[idh][1]->Fit("gaus", "Q");
3962  }
3963  page++;
3964  c1->Update();
3965 
3966  ps->NewPage();
3967  c1->Clear();
3968  c1->cd(0);
3969  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#eta_rec-#eta_sim, endcap2");
3970  title->SetFillColor(10);
3971  title->Draw();
3972  sprintf(pagenum, "- %d -", page);
3973  t.DrawText(0.9, 0.02, pagenum);
3974  pad[page]->Draw();
3975  pad[page]->Divide(2, 5);
3976  for (int idh = 0; idh < max_idh; idh++) {
3977  if (!plotME1A && idh == 3)
3978  continue;
3979  hEtaDiffCsc[idh][2]->GetXaxis()->SetLabelSize(0.07); // default=0.04
3980  hEtaDiffCsc[idh][2]->GetYaxis()->SetLabelSize(0.07);
3981  pad[page]->cd(idh + 1);
3982  hEtaDiffCsc[idh][2]->Draw();
3983  if (hEtaDiffCsc[idh][2]->GetEntries() > 1)
3984  hEtaDiffCsc[idh][2]->Fit("gaus", "Q");
3985  }
3986  page++;
3987  c1->Update();
3988 
3989  ps->NewPage();
3990  c1->Clear();
3991  c1->cd(0);
3992  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#LT#eta_rec-#eta_sim#GT vs #eta_rec");
3993  title->SetFillColor(10);
3994  title->Draw();
3995  sprintf(pagenum, "- %d -", page);
3996  t.DrawText(0.9, 0.02, pagenum);
3997  //gStyle->SetOptStat(0);
3998  pad[page]->Draw();
3999  pad[page]->Divide(2, 2);
4000  TH1F* hMeanEtaDiffVsEta[MAX_STATIONS];
4001  for (int istation = 0; istation < MAX_STATIONS; istation++) {
4002  hMeanEtaDiffVsEta[istation] = (TH1F*)hEtaDiffVsEta[istation]->Clone();
4003  hMeanEtaDiffVsEta[istation]->Divide(hEtaDiffVsEta[istation], hAlctVsEta[istation], 1., 1.);
4004  hMeanEtaDiffVsEta[istation]->GetXaxis()->SetTitleOffset(1.2);
4005  hMeanEtaDiffVsEta[istation]->GetXaxis()->SetTitle("#eta");
4006  hMeanEtaDiffVsEta[istation]->SetMaximum(0.05);
4007  pad[page]->cd(istation + 1);
4008  hMeanEtaDiffVsEta[istation]->Draw();
4009  }
4010  page++;
4011  c1->Update();
4012 
4013  c1->Clear();
4014  c1->cd(0);
4015  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#eta_rec-#eta_sim vs wiregroup");
4016  title->SetFillColor(10);
4017  title->Draw();
4018  sprintf(pagenum, "- %d -", page);
4019  t.DrawText(0.9, 0.02, pagenum);
4020  pad[page]->Draw();
4021  pad[page]->Divide(2, 5);
4022  for (int idh = 0; idh < max_idh; idh++) {
4023  if (!plotME1A && idh == 3)
4024  continue;
4025  pad[page]->cd(idh + 1);
4026  hEtaDiffVsWireCsc[idh]->SetMarkerSize(0.2);
4027  hEtaDiffVsWireCsc[idh]->GetXaxis()->SetTitle("Wiregroup");
4028  hEtaDiffVsWireCsc[idh]->GetXaxis()->SetTitleSize(0.07);
4029  hEtaDiffVsWireCsc[idh]->GetXaxis()->SetTitleOffset(1.2);
4030  hEtaDiffVsWireCsc[idh]->GetYaxis()->SetTitle("#eta_rec-#eta_sim");
4031  hEtaDiffVsWireCsc[idh]->GetYaxis()->SetTitleSize(0.07);
4032  hEtaDiffVsWireCsc[idh]->GetXaxis()->SetLabelSize(0.07); // default=0.04
4033  hEtaDiffVsWireCsc[idh]->GetYaxis()->SetLabelSize(0.07);
4034  hEtaDiffVsWireCsc[idh]->Draw();
4035  }
4036  page++;
4037  c1->Update();
4038 
4039  ps->NewPage();
4040  c1->Clear();
4041  c1->cd(0);
4042  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#phi resolution");
4043  title->SetFillColor(10);
4044  title->Draw();
4045  sprintf(pagenum, "- %d -", page);
4046  t.DrawText(0.9, 0.02, pagenum);
4047  gStyle->SetOptStat(111110);
4048  pad[page]->Draw();
4049  pad[page]->Divide(2, 2);
4050  gStyle->SetStatX(1.00);
4051  gStyle->SetStatY(0.65);
4052  pad[page]->cd(1);
4053  hPhiRecVsSim->SetMarkerSize(0.2);
4054  hPhiRecVsSim->Draw();
4055  gPad->Update();
4056  gStyle->SetStatX(1.00);
4057  gStyle->SetStatY(0.995);
4058  hResolDeltaPhi->GetXaxis()->SetLabelSize(0.04);
4059  hResolDeltaPhi->GetYaxis()->SetLabelSize(0.04);
4060  pad[page]->cd(2);
4061  hResolDeltaPhi->Draw();
4062  hResolDeltaPhi->Fit("gaus", "Q");
4063  hResolDeltaHS->GetXaxis()->SetTitle("HS_{rec} - HS_{sim}");
4064  hResolDeltaHS->GetXaxis()->SetTitleOffset(1.2);
4065  hResolDeltaHS->GetYaxis()->SetTitle("Entries");
4066  hResolDeltaHS->GetYaxis()->SetTitleOffset(1.7);
4067  hResolDeltaHS->GetXaxis()->SetLabelSize(0.03);
4068  hResolDeltaHS->GetYaxis()->SetLabelSize(0.03);
4069  pad[page]->cd(3);
4070  hResolDeltaHS->Draw();
4071  hResolDeltaDS->GetXaxis()->SetTitle("DS_{rec} - DS_{sim}");
4072  hResolDeltaDS->GetXaxis()->SetTitleOffset(1.2);
4073  hResolDeltaDS->GetYaxis()->SetTitle("Entries");
4074  hResolDeltaDS->GetYaxis()->SetTitleOffset(1.6);
4075  hResolDeltaDS->GetXaxis()->SetLabelSize(0.04);
4076  hResolDeltaDS->GetYaxis()->SetLabelSize(0.04);
4077  pad[page]->cd(4);
4078  hResolDeltaDS->Draw();
4079  page++;
4080  c1->Update();
4081 
4082  ps->NewPage();
4083  c1->Clear();
4084  c1->cd(0);
4085  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#phi_rec-#phi_sim (mrad)");
4086  title->SetFillColor(10);
4087  title->Draw();
4088  sprintf(pagenum, "- %d -", page);
4089  t.DrawText(0.9, 0.02, pagenum);
4090  pad[page]->Draw();
4091  pad[page]->Divide(2, 5);
4092  for (int idh = 0; idh < max_idh; idh++) {
4093  if (!plotME1A && idh == 3)
4094  continue;
4095  hPhiDiffCsc[idh][0]->GetXaxis()->SetLabelSize(0.07); // default=0.04
4096  hPhiDiffCsc[idh][0]->GetYaxis()->SetLabelSize(0.07);
4097  pad[page]->cd(idh + 1);
4098  hPhiDiffCsc[idh][0]->Draw();
4099  if (hPhiDiffCsc[idh][0]->GetEntries() > 1)
4100  hPhiDiffCsc[idh][0]->Fit("gaus", "Q");
4101  }
4102  page++;
4103  c1->Update();
4104 
4105  ps->NewPage();
4106  c1->Clear();
4107  c1->cd(0);
4108  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#phi_rec-#phi_sim (mrad), endcap1");
4109  title->SetFillColor(10);
4110  title->Draw();
4111  sprintf(pagenum, "- %d -", page);
4112  t.DrawText(0.9, 0.02, pagenum);
4113  pad[page]->Draw();
4114  pad[page]->Divide(2, 5);
4115  for (int idh = 0; idh < max_idh; idh++) {
4116  if (!plotME1A && idh == 3)
4117  continue;
4118  hPhiDiffCsc[idh][1]->GetXaxis()->SetLabelSize(0.07); // default=0.04
4119  hPhiDiffCsc[idh][1]->GetYaxis()->SetLabelSize(0.07);
4120  pad[page]->cd(idh + 1);
4121  hPhiDiffCsc[idh][1]->Draw();
4122  if (hPhiDiffCsc[idh][1]->GetEntries() > 1)
4123  hPhiDiffCsc[idh][1]->Fit("gaus", "Q");
4124  }
4125  page++;
4126  c1->Update();
4127 
4128  ps->NewPage();
4129  c1->Clear();
4130  c1->cd(0);
4131  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#phi_rec-#phi_sim (mrad), endcap2");
4132  title->SetFillColor(10);
4133  title->Draw();
4134  sprintf(pagenum, "- %d -", page);
4135  t.DrawText(0.9, 0.02, pagenum);
4136  pad[page]->Draw();
4137  pad[page]->Divide(2, 5);
4138  for (int idh = 0; idh < max_idh; idh++) {
4139  if (!plotME1A && idh == 3)
4140  continue;
4141  hPhiDiffCsc[idh][2]->GetXaxis()->SetLabelSize(0.07); // default=0.04
4142  hPhiDiffCsc[idh][2]->GetYaxis()->SetLabelSize(0.07);
4143  pad[page]->cd(idh + 1);
4144  hPhiDiffCsc[idh][2]->Draw();
4145  if (hPhiDiffCsc[idh][2]->GetEntries() > 1)
4146  hPhiDiffCsc[idh][2]->Fit("gaus", "Q");
4147  }
4148  page++;
4149  c1->Update();
4150 
4151  ps->NewPage();
4152  c1->Clear();
4153  c1->cd(0);
4154  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#LT#phi_rec-#phi_sim#GT (mrad) vs #phi_rec");
4155  title->SetFillColor(10);
4156  title->Draw();
4157  sprintf(pagenum, "- %d -", page);
4158  t.DrawText(0.9, 0.02, pagenum);
4159  gStyle->SetOptStat(0);
4160  pad[page]->Draw();
4161  pad[page]->Divide(2, 2);
4162  TH1F* hMeanPhiDiffVsPhi[MAX_STATIONS];
4163  for (int istation = 0; istation < MAX_STATIONS; istation++) {
4164  hMeanPhiDiffVsPhi[istation] = (TH1F*)hPhiDiffVsPhi[istation]->Clone();
4165  hMeanPhiDiffVsPhi[istation]->Divide(hPhiDiffVsPhi[istation], hClctVsPhi[istation], 1., 1.);
4166  hMeanPhiDiffVsPhi[istation]->GetXaxis()->SetTitleOffset(1.2);
4167  hMeanPhiDiffVsPhi[istation]->GetYaxis()->SetTitleOffset(1.7);
4168  hMeanPhiDiffVsPhi[istation]->GetXaxis()->SetTitle("#phi");
4169  hMeanPhiDiffVsPhi[istation]->GetYaxis()->SetTitle("#LT#phi_rec-#phi_sim#GT (mrad)");
4170  hMeanPhiDiffVsPhi[istation]->SetMaximum(5.);
4171  pad[page]->cd(istation + 1);
4172  hMeanPhiDiffVsPhi[istation]->Draw();
4173  }
4174  page++;
4175  c1->Update();
4176 
4177  c1->Clear();
4178  c1->cd(0);
4179  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#phi_rec-#phi_sim (mrad) vs halfstrip #");
4180  title->SetFillColor(10);
4181  title->Draw();
4182  sprintf(pagenum, "- %d -", page);
4183  t.DrawText(0.9, 0.02, pagenum);
4184  gStyle->SetOptStat(0);
4185  pad[page]->Draw();
4186  pad[page]->Divide(2, 5);
4187  for (int idh = 0; idh < max_idh; idh++) {
4188  if (!plotME1A && idh == 3)
4189  continue;
4190  pad[page]->cd(idh + 1);
4191  hPhiDiffVsStripCsc[idh][1]->SetMarkerSize(0.2);
4192  hPhiDiffVsStripCsc[idh][1]->GetXaxis()->SetTitle("Halfstrip");
4193  hPhiDiffVsStripCsc[idh][1]->GetXaxis()->SetTitleOffset(1.4);
4194  hPhiDiffVsStripCsc[idh][1]->GetYaxis()->SetTitle("#phi_rec-#phi_sim (mrad)");
4195  hPhiDiffVsStripCsc[idh][1]->GetXaxis()->SetLabelSize(0.07); // default=0.04
4196  hPhiDiffVsStripCsc[idh][1]->GetYaxis()->SetLabelSize(0.07);
4197  hPhiDiffVsStripCsc[idh][1]->Draw();
4198  }
4199  page++;
4200  c1->Update();
4201 
4202  c1->Clear();
4203  c1->cd(0);
4204  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#phi_rec-#phi_sim, halfstrips only, different patterns");
4205  title->SetFillColor(10);
4206  title->Draw();
4207  sprintf(pagenum, "- %d -", page);
4208  t.DrawText(0.9, 0.02, pagenum);
4209  gStyle->SetOptStat(111110);
4210  pad[page]->Draw();
4211  pad[page]->Divide(3, 3);
4212  int min_pattern, max_pattern;
4213  min_pattern = 2;
4214  max_pattern = CSCConstants::NUM_CLCT_PATTERNS;
4215  for (int idh = min_pattern; idh < max_pattern; idh++) {
4216  hPhiDiffPattern[idh]->GetXaxis()->SetTitle("Halfstrip");
4217  hPhiDiffPattern[idh]->GetXaxis()->SetTitleOffset(1.2);
4218  pad[page]->cd(idh - min_pattern + 1);
4219  hPhiDiffPattern[idh]->Draw();
4220  // if (hPhiDiffPattern[idh]->GetEntries() > 1)
4221  // hPhiDiffPattern[idh]->Fit("gaus","Q");
4222  }
4223  page++;
4224  c1->Update();
4225 
4226  ps->NewPage();
4227  c1->Clear();
4228  c1->cd(0);
4229  title = new TPaveLabel(0.1, 0.94, 0.9, 0.98, "#phi_1-#phi_6 (mrad), muon SimHits");
4230  title->SetFillColor(10);
4231  title->Draw();
4232  sprintf(pagenum, "- %d -", page);
4233  t.DrawText(0.9, 0.02, pagenum);
4234  pad[page]->Draw();
4235  pad[page]->Divide(2, 5);
4236  for (int idh = 0; idh < max_idh; idh++) {
4237  if (!plotME1A && idh == 3)
4238  continue;
4239  hTrueBendCsc[idh]->GetYaxis()->SetTitle("Entries");
4240  hTrueBendCsc[idh]->GetYaxis()->SetTitleSize(0.07);
4241  hTrueBendCsc[idh]->GetXaxis()->SetLabelSize(0.07); // default=0.04
4242  hTrueBendCsc[idh]->GetYaxis()->SetLabelSize(0.07);
4243  pad[page]->cd(idh + 1);
4244  hTrueBendCsc[idh]->Draw();
4245  }
4246  page++;
4247  c1->Update();
4248 
4249  ps->Close();
4250  delete c1;
4251 }
TH1F * hPhiDiffPattern[CSCConstants::NUM_CLCT_PATTERNS]
string fname
main script
void CSCTriggerPrimitivesReader::endJob ( void  )
overridevirtual

Write to ROOT file, make plots, etc.

Reimplemented from edm::EDAnalyzer.

Definition at line 505 of file CSCTriggerPrimitivesReader.cc.

References bookedALCTHistos, bookedCLCTHistos, bookedCompHistos, bookedEfficHistos, bookedLCTTMBHistos, bookedResolHistos, csc_type, CSC_TYPES, drawALCTHistos(), drawCLCTHistos(), drawCompHistos(), drawEfficHistos(), drawLCTTMBHistos(), drawResolHistos(), eventsAnalyzed, hEfficALCTEtaCsc, hEfficCLCTEtaCsc, hEfficHitsEtaCsc, hResolDeltaHS, hResolDeltaWG, numALCT, numCLCT, numLCTMPC, numLCTTMB, and printps.

505  {
506  // Note: all operations involving ROOT should be placed here and not in the
507  // destructor.
508  // Plot histos if they were booked/filled.
509  if (printps) {
510  if (bookedALCTHistos)
511  drawALCTHistos();
512  if (bookedCLCTHistos)
513  drawCLCTHistos();
514  if (bookedLCTTMBHistos)
516  //if (bookedLCTMPCHistos) drawLCTMPCHistos();
517 
518  if (bookedCompHistos)
519  drawCompHistos();
520 
521  if (bookedResolHistos)
522  drawResolHistos();
523  if (bookedEfficHistos)
524  drawEfficHistos();
525  }
526  //drawHistosForTalks();
527 
528  //theFile->cd();
529  //theFile->Write();
530  //theFile->Close();
531 
532  // Job summary.
533  edm::LogInfo("CSCTriggerPrimitivesReader")
534  << "\n Average number of ALCTs/event = " << static_cast<float>(numALCT) / eventsAnalyzed << endl;
535  edm::LogInfo("CSCTriggerPrimitivesReader")
536  << " Average number of CLCTs/event = " << static_cast<float>(numCLCT) / eventsAnalyzed << endl;
537  edm::LogInfo("CSCTriggerPrimitivesReader")
538  << " Average number of TMB LCTs/event = " << static_cast<float>(numLCTTMB) / eventsAnalyzed << endl;
539  edm::LogInfo("CSCTriggerPrimitivesReader")
540  << " Average number of MPC LCTs/event = " << static_cast<float>(numLCTMPC) / eventsAnalyzed << endl;
541 
542  if (bookedEfficHistos) {
543  {
544  edm::LogInfo("CSCTriggerPrimitivesReader") << "\n ALCT efficiencies:";
545  double tot_simh = 0.0, tot_alct = 0.0;
546  for (int idh = 0; idh < CSC_TYPES; idh++) {
547  double simh = hEfficHitsEtaCsc[idh]->Integral();
548  double alct = hEfficALCTEtaCsc[idh]->Integral();
549  double eff = 0.;
550  if (simh > 0)
551  eff = alct / simh;
552  edm::LogInfo("CSCTriggerPrimitivesReader")
553  << " " << csc_type[idh] << ": alct = " << alct << ", simh = " << simh << " eff = " << eff;
554  tot_simh += simh;
555  tot_alct += alct;
556  }
557  edm::LogInfo("CSCTriggerPrimitivesReader")
558  << " overall: alct = " << tot_alct << ", simh = " << tot_simh << " eff = " << tot_alct / tot_simh;
559  }
560 
561  {
562  edm::LogInfo("CSCTriggerPrimitivesReader") << "\n CLCT efficiencies:";
563  double tot_simh = 0.0, tot_clct = 0.0;
564  for (int idh = 0; idh < CSC_TYPES; idh++) {
565  double simh = hEfficHitsEtaCsc[idh]->Integral();
566  double clct = hEfficCLCTEtaCsc[idh]->Integral();
567  double eff = 0.;
568  if (simh > 0.)
569  eff = clct / simh;
570  edm::LogInfo("CSCTriggerPrimitivesReader")
571  << " " << csc_type[idh] << ": clct = " << clct << ", simh = " << simh << " eff = " << eff;
572  tot_simh += simh;
573  tot_clct += clct;
574  }
575  edm::LogInfo("CSCTriggerPrimitivesReader")
576  << " overall: clct = " << tot_clct << ", simh = " << tot_simh << " eff = " << tot_clct / tot_simh;
577  }
578  }
579 
580  if (bookedResolHistos) {
581  double cor = 0.0, tot = 0.0;
582  cor = hResolDeltaHS->GetBinContent(hResolDeltaHS->FindBin(0.));
583  tot = hResolDeltaHS->GetEntries();
584  edm::LogInfo("CSCTriggerPrimitivesReader")
585  << "\n Correct half-strip assigned in " << cor << "/" << tot << " = " << cor / tot << " of half-strip CLCTs";
586  //cor = hResolDeltaDS->GetBinContent(hResolDeltaDS->FindBin(0.));
587  //tot = hResolDeltaDS->GetEntries();
588  //edm::LogInfo("CSCTriggerPrimitivesReader")
589  // << " Correct di-strip assigned in " << cor << "/" << tot
590  // << " = " << cor/tot << " of di-strip CLCTs";
591  cor = hResolDeltaWG->GetBinContent(hResolDeltaWG->FindBin(0.));
592  tot = hResolDeltaWG->GetEntries();
593  edm::LogInfo("CSCTriggerPrimitivesReader")
594  << " Correct wire group assigned in " << cor << "/" << tot << " = " << cor / tot << " of ALCTs";
595  }
596 }
static const std::string csc_type[CSC_TYPES]
void CSCTriggerPrimitivesReader::fillALCTHistos ( const CSCALCTDigiCollection alcts)
private

Definition at line 1128 of file CSCTriggerPrimitivesReader.cc.

References badChambers_, bookALCTHistos(), bookedALCTHistos, relativeConstraints::chamber, checkBadChambers_, debug, getCSCType(), hAlctAccel, hAlctBXN, hAlctCollis, hAlctCsc, hAlctKeyGroup, hAlctKeyGroupME11, hAlctPerChamber, hAlctPerCSC, hAlctPerEvent, hAlctQuality, hAlctValid, CSCBadChambers::isInBadChamber(), LogTrace, numALCT, and FastTimerService_cff::range.

Referenced by analyze().

1128  {
1129  // Book histos when called for the first time.
1130  if (!bookedALCTHistos)
1131  bookALCTHistos();
1132 
1133  int nValidALCTs = 0;
1134  for (auto detUnitIt = alcts->begin(); detUnitIt != alcts->end(); detUnitIt++) {
1135  int nValidALCTsPerCSC = 0;
1136  const CSCDetId& id = (*detUnitIt).first;
1138  continue;
1139  const auto& range = (*detUnitIt).second;
1140  for (auto digiIt = range.first; digiIt != range.second; digiIt++) {
1141  bool alct_valid = (*digiIt).isValid();
1142  hAlctValid->Fill(alct_valid);
1143  if (alct_valid) {
1144  hAlctQuality->Fill((*digiIt).getQuality());
1145  hAlctAccel->Fill((*digiIt).getAccelerator());
1146  hAlctCollis->Fill((*digiIt).getCollisionB());
1147  hAlctKeyGroup->Fill((*digiIt).getKeyWG());
1148  hAlctBXN->Fill((*digiIt).getBX());
1149 
1150  int csctype = getCSCType(id);
1151  hAlctPerCSC->Fill(csctype);
1152  hAlctCsc[id.endcap() - 1][csctype]->Fill(id.chamber());
1153 
1154  if (csctype == 0)
1155  hAlctKeyGroupME11->Fill((*digiIt).getKeyWG());
1156 
1157  nValidALCTs++;
1158  nValidALCTsPerCSC++;
1159 
1160  if (debug)
1161  LogTrace("CSCTriggerPrimitivesReader")
1162  << (*digiIt) << " found in ME" << ((id.endcap() == 1) ? "+" : "-") << id.station() << "/" << id.ring()
1163  << "/" << id.chamber() << " (sector " << id.triggerSector() << " trig id. " << id.triggerCscId() << ")";
1164  //cout << "raw id = " << id.rawId() << endl;
1165  }
1166  }
1167  hAlctPerChamber->Fill(nValidALCTsPerCSC);
1168  }
1169  hAlctPerEvent->Fill(nValidALCTs);
1170  if (debug)
1171  LogTrace("CSCTriggerPrimitivesReader") << nValidALCTs << " valid ALCTs found in this event";
1172  numALCT += nValidALCTs;
1173 }
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
#define LogTrace(id)
TH1F * hAlctCsc[MAX_ENDCAPS][CSC_TYPES]
void CSCTriggerPrimitivesReader::fillCLCTHistos ( const CSCCLCTDigiCollection clcts)
private

Definition at line 1175 of file CSCTriggerPrimitivesReader.cc.

References funct::abs(), badChambers_, bookCLCTHistos(), bookedCLCTHistos, relativeConstraints::chamber, checkBadChambers_, debug, getCSCType(), hClctBendCsc, hClctBXN, hClctCFEB, hClctCsc, hClctKeyStrip, hClctKeyStripCsc, hClctKeyStripME11, hClctPattern, hClctPerChamber, hClctPerCSC, hClctPerEvent, hClctQuality, hClctSign, hClctStripType, hClctValid, CSCBadChambers::isInBadChamber(), LogTrace, numCLCT, topSingleLeptonDQM_PU_cfi::pattern, ptype_TMB07, and FastTimerService_cff::range.

Referenced by analyze().

1175  {
1176  // Book histos when called for the first time.
1177  if (!bookedCLCTHistos)
1178  bookCLCTHistos();
1179 
1180  int nValidCLCTs = 0;
1181  for (auto detUnitIt = clcts->begin(); detUnitIt != clcts->end(); detUnitIt++) {
1182  int nValidCLCTsPerCSC = 0;
1183  const CSCDetId& id = (*detUnitIt).first;
1185  continue;
1186  const auto& range = (*detUnitIt).second;
1187  for (auto digiIt = range.first; digiIt != range.second; digiIt++) {
1188  bool clct_valid = (*digiIt).isValid();
1189  hClctValid->Fill(clct_valid);
1190  if (clct_valid) {
1191  int striptype = (*digiIt).getStripType();
1192  int keystrip = (*digiIt).getKeyStrip(); // halfstrip #
1193  if (striptype == 0)
1194  keystrip /= 4; // distrip # for distrip ptns
1195  hClctQuality->Fill((*digiIt).getQuality());
1196  hClctStripType->Fill(striptype);
1197  hClctSign->Fill((*digiIt).getBend());
1198  hClctCFEB->Fill((*digiIt).getCFEB());
1199  hClctBXN->Fill((*digiIt).getBX());
1200  hClctKeyStrip[striptype]->Fill(keystrip);
1201  hClctPattern[striptype]->Fill((*digiIt).getPattern());
1202 
1203  int csctype = getCSCType(id);
1204  hClctPerCSC->Fill(csctype);
1205  hClctCsc[id.endcap() - 1][csctype]->Fill(id.chamber());
1206 
1207  if (striptype == 1 && csctype == 0)
1208  hClctKeyStripME11->Fill(keystrip);
1209 
1210  int phibend;
1211  int pattern = (*digiIt).getPattern();
1212  phibend = ptype_TMB07[pattern];
1213  hClctBendCsc[csctype][striptype]->Fill(abs(phibend));
1214 
1215  if (striptype == 0) // distrips
1216  hClctKeyStripCsc[csctype]->Fill(keystrip);
1217 
1218  nValidCLCTs++;
1219  nValidCLCTsPerCSC++;
1220 
1221  if (debug)
1222  LogTrace("CSCTriggerPrimitivesReader")
1223  << (*digiIt) << " found in ME" << ((id.endcap() == 1) ? "+" : "-") << id.station() << "/" << id.ring()
1224  << "/" << id.chamber() << " (sector " << id.triggerSector() << " trig id. " << id.triggerCscId() << ")";
1225  }
1226  }
1227  hClctPerChamber->Fill(nValidCLCTsPerCSC);
1228  }
1229  hClctPerEvent->Fill(nValidCLCTs);
1230  if (debug)
1231  LogTrace("CSCTriggerPrimitivesReader") << nValidCLCTs << " valid CLCTs found in this event";
1232  numCLCT += nValidCLCTs;
1233 }
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define LogTrace(id)
TH1F * hClctCsc[MAX_ENDCAPS][CSC_TYPES]
static const int ptype_TMB07[CSCConstants::NUM_CLCT_PATTERNS]
void CSCTriggerPrimitivesReader::fillLCTMPCHistos ( const CSCCorrelatedLCTDigiCollection lcts)
private

Definition at line 1307 of file CSCTriggerPrimitivesReader.cc.

References badChambers_, bookedLCTMPCHistos, bookLCTMPCHistos(), checkBadChambers_, debug, makeMuonMisalignmentScenario::endcap, getCSCType(), hCorrLctMPCPerCSC, hLctMPCBend, hLctMPCBXN, hLctMPCChamber, hLctMPCEndcap, hLctMPCKeyGroup, hLctMPCKeyGroupME11, hLctMPCKeyStrip, hLctMPCKeyStripME11, hLctMPCPattern, hLctMPCPerCSC, hLctMPCPerEvent, hLctMPCQuality, hLctMPCRing, hLctMPCSector, hLctMPCStation, hLctMPCStripType, hLctMPCValid, CSCBadChambers::isInBadChamber(), LogTrace, numLCTMPC, qcdUeDQM_cfi::quality, FastTimerService_cff::range, relativeConstraints::ring, relativeConstraints::station, triggerCscId(), and triggerSector().

1307  {
1308  // Book histos when called for the first time.
1309  if (!bookedLCTMPCHistos)
1310  bookLCTMPCHistos();
1311 
1312  int nValidLCTs = 0;
1313  bool alct_valid, clct_valid;
1314 
1315  for (auto detUnitIt = lcts->begin(); detUnitIt != lcts->end(); detUnitIt++) {
1316  const CSCDetId& id = (*detUnitIt).first;
1318  continue;
1319  const auto& range = (*detUnitIt).second;
1320  for (auto digiIt = range.first; digiIt != range.second; digiIt++) {
1321  bool lct_valid = (*digiIt).isValid();
1322  hLctMPCValid->Fill(lct_valid);
1323  if (lct_valid) {
1324  hLctMPCEndcap->Fill(id.endcap());
1325  hLctMPCStation->Fill(id.station());
1326  hLctMPCSector->Fill(id.triggerSector());
1327  hLctMPCRing->Fill(id.ring());
1328  hLctMPCChamber[id.station() - 1]->Fill(id.triggerCscId());
1329 
1330  int quality = (*digiIt).getQuality();
1331  hLctMPCQuality->Fill(quality);
1332  hLctMPCBXN->Fill((*digiIt).getBX());
1333 
1334  alct_valid = (quality != 0 && quality != 2);
1335  if (alct_valid) {
1336  hLctMPCKeyGroup->Fill((*digiIt).getKeyWG());
1337  }
1338 
1339  clct_valid = (quality != 0 && quality != 1);
1340  if (clct_valid) {
1341  hLctMPCKeyStrip->Fill((*digiIt).getStrip());
1342  hLctMPCStripType->Fill(1.);
1343  hLctMPCPattern->Fill((*digiIt).getPattern());
1344  hLctMPCBend->Fill((*digiIt).getBend());
1345  }
1346 
1347  int csctype = getCSCType(id);
1348  hLctMPCPerCSC->Fill(csctype);
1349  // Truly correlated LCTs; for DAQ
1350  if (alct_valid && clct_valid)
1351  hCorrLctMPCPerCSC->Fill(csctype);
1352 
1353  if (alct_valid && csctype == 0) {
1354  hLctMPCKeyGroupME11->Fill((*digiIt).getKeyWG());
1355  }
1356  if (clct_valid && csctype == 0) {
1357  hLctMPCKeyStripME11->Fill((*digiIt).getStrip());
1358  }
1359 
1360  nValidLCTs++;
1361 
1362  if (debug)
1363  LogTrace("CSCTriggerPrimitivesReader")
1364  << "MPC " << (*digiIt) << " found in ME" << ((id.endcap() == 1) ? "+" : "-") << id.station() << "/"
1365  << id.ring() << "/" << id.chamber() << " (sector " << id.triggerSector() << " trig id. "
1366  << id.triggerCscId() << ")";
1367  }
1368  }
1369  }
1370  hLctMPCPerEvent->Fill(nValidLCTs);
1371  if (debug)
1372  LogTrace("CSCTriggerPrimitivesReader") << nValidLCTs << " MPC LCTs found in this event";
1373  numLCTMPC += nValidLCTs;
1374 }
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
#define LogTrace(id)
Int_t triggerSector(Int_t station, Int_t ring, Int_t chamber) const
Int_t triggerCscId(Int_t station, Int_t ring, Int_t chamber) const
void CSCTriggerPrimitivesReader::fillLCTTMBHistos ( const CSCCorrelatedLCTDigiCollection lcts)
private

Definition at line 1235 of file CSCTriggerPrimitivesReader.cc.

References badChambers_, bookedLCTTMBHistos, bookLCTTMBHistos(), relativeConstraints::chamber, checkBadChambers_, debug, makeMuonMisalignmentScenario::endcap, getCSCType(), hCorrLctTMBPerCSC, hLctTMBBend, hLctTMBBXN, hLctTMBChamber, hLctTMBCsc, hLctTMBEndcap, hLctTMBKeyGroup, hLctTMBKeyGroupME11, hLctTMBKeyStrip, hLctTMBKeyStripME11, hLctTMBPattern, hLctTMBPerChamber, hLctTMBPerCSC, hLctTMBPerEvent, hLctTMBQuality, hLctTMBRing, hLctTMBSector, hLctTMBStation, hLctTMBStripType, hLctTMBValid, CSCBadChambers::isInBadChamber(), LogTrace, numLCTTMB, qcdUeDQM_cfi::quality, FastTimerService_cff::range, relativeConstraints::ring, relativeConstraints::station, triggerCscId(), and triggerSector().

Referenced by analyze().

1235  {
1236  // Book histos when called for the first time.
1237  if (!bookedLCTTMBHistos)
1238  bookLCTTMBHistos();
1239 
1240  int nValidLCTs = 0;
1241  bool alct_valid, clct_valid;
1242 
1243  for (auto detUnitIt = lcts->begin(); detUnitIt != lcts->end(); detUnitIt++) {
1244  int nValidLCTsPerCSC = 0;
1245  const CSCDetId& id = (*detUnitIt).first;
1247  continue;
1248  const auto& range = (*detUnitIt).second;
1249  for (auto digiIt = range.first; digiIt != range.second; digiIt++) {
1250  bool lct_valid = (*digiIt).isValid();
1251  hLctTMBValid->Fill(lct_valid);
1252  if (lct_valid) {
1253  hLctTMBEndcap->Fill(id.endcap());
1254  hLctTMBStation->Fill(id.station());
1255  hLctTMBSector->Fill(id.triggerSector());
1256  hLctTMBRing->Fill(id.ring());
1257  hLctTMBChamber[id.station() - 1]->Fill(id.triggerCscId());
1258 
1259  int quality = (*digiIt).getQuality();
1260  hLctTMBQuality->Fill(quality);
1261  hLctTMBBXN->Fill((*digiIt).getBX());
1262 
1263  alct_valid = (quality != 0 && quality != 2);
1264  if (alct_valid) {
1265  hLctTMBKeyGroup->Fill((*digiIt).getKeyWG());
1266  }
1267 
1268  clct_valid = (quality != 0 && quality != 1);
1269  if (clct_valid) {
1270  hLctTMBKeyStrip->Fill((*digiIt).getStrip());
1271  hLctTMBStripType->Fill(1.);
1272  hLctTMBPattern->Fill((*digiIt).getPattern());
1273  hLctTMBBend->Fill((*digiIt).getBend());
1274  }
1275 
1276  int csctype = getCSCType(id);
1277  hLctTMBPerCSC->Fill(csctype);
1278  hLctTMBCsc[id.endcap() - 1][csctype]->Fill(id.chamber());
1279  // Truly correlated LCTs; for DAQ
1280  if (alct_valid && clct_valid)
1281  hCorrLctTMBPerCSC->Fill(csctype);
1282 
1283  if (alct_valid && csctype == 0) {
1284  hLctTMBKeyGroupME11->Fill((*digiIt).getKeyWG());
1285  }
1286  if (clct_valid && csctype == 0) {
1287  hLctTMBKeyStripME11->Fill((*digiIt).getStrip());
1288  }
1289 
1290  nValidLCTs++;
1291  nValidLCTsPerCSC++;
1292 
1293  if (debug)
1294  LogTrace("CSCTriggerPrimitivesReader")
1295  << (*digiIt) << " found in ME" << ((id.endcap() == 1) ? "+" : "-") << id.station() << "/" << id.ring()
1296  << "/" << id.chamber() << " (sector " << id.triggerSector() << " trig id. " << id.triggerCscId() << ")";
1297  }
1298  }
1299  hLctTMBPerChamber->Fill(nValidLCTsPerCSC);
1300  }
1301  hLctTMBPerEvent->Fill(nValidLCTs);
1302  if (debug)
1303  LogTrace("CSCTriggerPrimitivesReader") << nValidLCTs << " valid LCTs found in this event";
1304  numLCTTMB += nValidLCTs;
1305 }
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
#define LogTrace(id)
TH1F * hLctTMBCsc[MAX_ENDCAPS][CSC_TYPES]
Int_t triggerSector(Int_t station, Int_t ring, Int_t chamber) const
Int_t triggerCscId(Int_t station, Int_t ring, Int_t chamber) const
int CSCTriggerPrimitivesReader::getCSCType ( const CSCDetId id)
private

Definition at line 4692 of file CSCTriggerPrimitivesReader.cc.

References CSC_TYPES, relativeConstraints::ring, and relativeConstraints::station.

Referenced by calcEfficiency(), calcResolution(), compareALCTs(), compareCLCTs(), compareLCTs(), fillALCTHistos(), fillCLCTHistos(), fillLCTMPCHistos(), and fillLCTTMBHistos().

4692  {
4693  int type = -999;
4694 
4695  if (id.station() == 1) {
4696  type = (id.triggerCscId() - 1) / 3;
4697  if (id.ring() == 4) {
4698  type = 3;
4699  }
4700  } else { // stations 2-4
4701  type = 3 + id.ring() + 2 * (id.station() - 2);
4702  }
4703 
4704  assert(type >= 0 && type < CSC_TYPES);
4705  return type;
4706 }
type
Definition: HCALResponse.h:21
GlobalPoint CSCTriggerPrimitivesReader::getGlobalPosition ( unsigned int  rawId,
int  keWg,
int  keyHS 
) const
private

Definition at line 4637 of file CSCTriggerPrimitivesReader.cc.

References CSCDetId::chamber(), CSCGeometry::chamber(), CSCDetId::endcap(), geom_, CSCLayer::geometry(), CSCGeometry::idToDet(), CSCConstants::KEY_CLCT_LAYER, CSCChamber::layer(), lut_wg_vs_hs_me1b, CSCLayerGeometry::middleWireOfGroup(), CSCDetId::ring(), relativeConstraints::ring, CSCDetId::station(), GeomDet::surface(), and Surface::toGlobal().

Referenced by compareALCTs(), compareCLCTs(), compareLCTs(), and compareMPCLCTs().

4637  {
4638  // taken from https://github.com/cms-sw/cmssw/blob/dc9f78b6af4ad56c9342cf14041b6485a60b0691/L1Trigger/CSCTriggerPrimitives/src/CSCTriggerPrimitivesReaderGEM.cc
4639  CSCDetId cscId = CSCDetId(rawId);
4640  int ring = cscId.ring();
4641  if (cscId.station() == 1 and cscId.ring() == 1 and (lut_wg_vs_hs_me1b[keyWg][0] < 0 || keyHS >= 128)) {
4642  ring = 4;
4643  if (keyHS >= 128)
4644  keyHS = keyHS - 128;
4645  }
4646 
4647  CSCDetId key_id(cscId.endcap(), cscId.station(), ring, cscId.chamber(), CSCConstants::KEY_CLCT_LAYER);
4648  auto cscChamber = geom_->chamber(cscId);
4649  float fractional_strip = 0.5 * (keyHS + 1) - 0.25;
4650  auto layer_geo = cscChamber->layer(CSCConstants::KEY_CLCT_LAYER)->geometry();
4651  // LCT::getKeyWG() also starts from 0
4652  float wire = layer_geo->middleWireOfGroup(keyWg + 1);
4653  LocalPoint csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
4654  GlobalPoint csc_gp = geom_->idToDet(key_id)->surface().toGlobal(csc_intersect);
4655  return csc_gp;
4656 }
int chamber() const
Definition: CSCDetId.h:62
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:81
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
int endcap() const
Definition: CSCDetId.h:85
float middleWireOfGroup(int wireGroup) const
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition: CSCChamber.cc:30
static const int lut_wg_vs_hs_me1b[48][2]
int ring() const
Definition: CSCDetId.h:68
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
int station() const
Definition: CSCDetId.h:79
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
double CSCTriggerPrimitivesReader::getHsPerRad ( const int  idh)
private

Definition at line 4709 of file CSCTriggerPrimitivesReader.cc.

References DEFINE_FWK_MODULE, MAX_HS, NCHAMBERS, and TWOPI.

Referenced by calcResolution().

4709 { return (NCHAMBERS[idh] * MAX_HS[idh] / TWOPI); }
static const int NCHAMBERS[CSC_TYPES]
static const int MAX_HS[CSC_TYPES]
void CSCTriggerPrimitivesReader::HotWires ( const edm::Event iEvent)

Definition at line 2598 of file CSCTriggerPrimitivesReader.cc.

References bookedHotWireHistos, bookHotWireHistos(), chamberSerial(), edm::Event::getByToken(), hHotCham1, hHotWire1, LaserClient_cfi::nbins, wireDigi_token_, and DigiDM_cff::wires.

Referenced by analyze().

2598  {
2599  if (!bookedHotWireHistos)
2602  // iEvent.getByLabel(wireDigiProducer_.label(), wireDigiProducer_.instance(), wires);
2603  iEvent.getByToken(wireDigi_token_, wires);
2604 
2605  int serial_old = -1;
2606  for (auto dWDiter = wires->begin(); dWDiter != wires->end(); dWDiter++) {
2607  CSCDetId id = (CSCDetId)(*dWDiter).first;
2608  int serial = chamberSerial(id) - 1;
2609  // printf("serial %i\n",serial);
2610  std::vector<CSCWireDigi>::const_iterator wireIter = (*dWDiter).second.first;
2611  std::vector<CSCWireDigi>::const_iterator lWire = (*dWDiter).second.second;
2612  bool has_layer = false;
2613  for (; wireIter != lWire; ++wireIter) {
2614  has_layer = true;
2615  int i_layer = id.layer() - 1;
2616  int i_wire = wireIter->getWireGroup() - 1;
2617  int nbins = wireIter->getTimeBinsOn().size();
2618  int serial2 = serial * (6 * 112) + i_layer * 112 + i_wire;
2619  /*
2620  printf("endcap %i, station %i, ring %i, chamber %i, serial %i, serial2 %i, layer %i, wg %i\n",
2621  id.endcap(), id.station(), id.ring(), id.chamber(), serial, serial2, i_layer, i_wire);
2622  */
2623  hHotWire1->Fill(serial2, nbins);
2624  /*
2625  if(id.station()==1) {
2626  printf("ring %i, chamber type %i, wg %i\n",id.ring(),id.iChamberType(),i_wire);
2627  }
2628  */
2629  }
2630  if (serial_old != serial && has_layer) {
2631  // nHotCham[serial]++;
2632  hHotCham1->Fill(serial);
2633  // printf("serial %i filled\n",serial);
2634  serial_old = serial;
2635  }
2636  }
2637 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< CSCWireDigiCollection > wireDigi_token_
int CSCTriggerPrimitivesReader::maxRing ( int  station)
private

Definition at line 354 of file CSCTriggerPrimitivesReader.cc.

References plotME1A.

Referenced by compareALCTs(), compareCLCTs(), compareLCTs(), and compareMPCLCTs().

354  {
355  if (station == 1) {
356  if (plotME1A)
357  return 4;
358  else
359  return 3;
360  }
361  return 2;
362 }
void CSCTriggerPrimitivesReader::MCStudies ( const edm::Event ev,
const CSCALCTDigiCollection alcts,
const CSCCLCTDigiCollection clcts 
)
private

Definition at line 2639 of file CSCTriggerPrimitivesReader.cc.

References calcEfficiency(), calcResolution(), compDigi_token_, compDigiProducer_, debug, edm::Event::getByToken(), edm::Event::getManyByType(), mps_fire::i, edm::HandleBase::isValid(), edm::InputTag::label(), LogDebug, LogTrace, M_PI, CaloTowersParam_cfi::mc, AlCaHLTBitMon_ParallelJobs::p, edm::Handle< T >::product(), simHit_token_, simHitProducer_, FastTrackerRecHitCombiner_cfi::simHits, wireDigi_token_, and wireDigiProducer_.

Referenced by analyze().

2641  {
2642  // MC particles, if any.
2643  //edm::Handle<edm::HepMCProduct> mcp;
2644  //ev.getByLabel("source", mcp);
2645  //ev.getByType(mcp);
2646  vector<edm::Handle<edm::HepMCProduct> > allhepmcp;
2647  // Use "getManyByType" to be able to check the existence of MC info.
2648  ev.getManyByType(allhepmcp);
2649 
2650  //cout << "HepMC info: " << allhepmcp.size() << endl;
2651  if (!allhepmcp.empty()) {
2652  const HepMC::GenEvent& mc = allhepmcp[0]->getHepMCData();
2653  int i = 0;
2654  for (HepMC::GenEvent::particle_const_iterator p = mc.particles_begin(); p != mc.particles_end(); ++p) {
2655  int id = (*p)->pdg_id();
2656  double phitmp = (*p)->momentum().phi();
2657  if (phitmp < 0)
2658  phitmp += 2. * M_PI;
2659  if (debug)
2660  LogDebug("CSCTriggerPrimitivesReader")
2661  << "MC part #" << ++i << ": id = " << id << ", status = " << (*p)->status()
2662  << "\n pX = " << (*p)->momentum().x() << ", pY = " << (*p)->momentum().y()
2663  << ", pT = " << (*p)->momentum().perp() << " GeV"
2664  << ", p = " << (*p)->momentum().rho() << " GeV"
2665  << "\n eta = " << (*p)->momentum().pseudoRapidity() << ", phi = " << phitmp << " ("
2666  << phitmp * 180. / M_PI << " deg)";
2667  }
2668 
2669  // If hepMC info is there, try to get wire and comparator digis,
2670  // and SimHits.
2674  // ev.getByLabel(wireDigiProducer_.label(), wireDigiProducer_.instance(),
2675  // wireDigis);
2676  // ev.getByLabel(compDigiProducer_.label(), compDigiProducer_.instance(),
2677  // compDigis);
2678  // ev.getByLabel(simHitProducer_.label(), simHitProducer_.instance(),
2679  // simHits);
2680  ev.getByToken(wireDigi_token_, wireDigis);
2681  ev.getByToken(compDigi_token_, compDigis);
2682  ev.getByToken(simHit_token_, simHitsH);
2683  const edm::PSimHitContainer& simHits = *simHitsH.product();
2684 
2685  if (!wireDigis.isValid()) {
2686  edm::LogWarning("L1CSCTPEmulatorWrongInput")
2687  << "+++ Warning: Collection of wire digis with label" << wireDigiProducer_.label()
2688  << " requested, but not found in the event... Skipping the rest +++\n";
2689  return;
2690  }
2691  if (!compDigis.isValid()) {
2692  edm::LogWarning("L1CSCTPEmulatorWrongInput")
2693  << "+++ Warning: Collection of comparator digis with label" << compDigiProducer_.label()
2694  << " requested, but not found in the event... Skipping the rest +++\n";
2695  return;
2696  }
2697  if (!simHitsH.isValid()) {
2698  edm::LogWarning("L1CSCTPEmulatorWrongInput")
2699  << "+++ Warning: Collection of SimHits with label" << simHitProducer_.label()
2700  << " requested, but not found in the event... Skipping the rest +++\n";
2701  return;
2702  }
2703 
2704  if (debug)
2705  LogTrace("CSCTriggerPrimitivesReader") << " #CSC SimHits: " << simHits.size();
2706 
2707  // MC-based resolution studies.
2708  calcResolution(alcts, clcts, wireDigis.product(), compDigis.product(), simHits);
2709 
2710  // MC-based efficiency studies.
2711  calcEfficiency(alcts, clcts, simHits);
2712  }
2713 }
#define LogDebug(id)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< CSCWireDigiCollection > wireDigi_token_
void getManyByType(std::vector< Handle< PROD >> &results) const
Definition: Event.h:516
void calcResolution(const CSCALCTDigiCollection *alcts, const CSCCLCTDigiCollection *clcts, const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const edm::PSimHitContainer &allSimHits)
void calcEfficiency(const CSCALCTDigiCollection *alcts, const CSCCLCTDigiCollection *clcts, const edm::PSimHitContainer &allSimHits)
bool isValid() const
Definition: HandleBase.h:70
#define LogTrace(id)
#define M_PI
T const * product() const
Definition: Handle.h:69
edm::EDGetTokenT< CSCComparatorDigiCollection > compDigi_token_
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< edm::PSimHitContainer > simHit_token_
std::vector< PSimHit > PSimHitContainer
void CSCTriggerPrimitivesReader::setRootStyle ( )
private

Definition at line 601 of file CSCTriggerPrimitivesReader.cc.

Referenced by CSCTriggerPrimitivesReader().

601  {
602  TH1::AddDirectory(false);
603 
604  gROOT->SetStyle("Plain");
605  gStyle->SetFillColor(0);
606  gStyle->SetOptDate();
607  gStyle->SetOptStat(111110);
608  gStyle->SetOptFit(1111);
609  gStyle->SetPadTickX(1);
610  gStyle->SetPadTickY(1);
611  gStyle->SetMarkerSize(0.5);
612  gStyle->SetMarkerStyle(8);
613  gStyle->SetGridStyle(3);
614  gStyle->SetPaperSize(TStyle::kA4);
615  gStyle->SetStatW(0.25); // width of statistics box; default is 0.19
616  gStyle->SetStatH(0.10); // height of statistics box; default is 0.1
617  gStyle->SetStatFormat("6.4g"); // leave default format for now
618  gStyle->SetTitleSize(0.055, ""); // size for pad title; default is 0.02
619  // Really big; useful for talks.
620  //gStyle->SetTitleSize(0.1, ""); // size for pad title; default is 0.02
621  gStyle->SetLabelSize(0.05, "XYZ"); // size for axis labels; default is 0.04
622  gStyle->SetStatFontSize(0.06); // size for stat. box
623  gStyle->SetTitleFont(32, "XYZ"); // times-bold-italic font (p. 153) for axes
624  gStyle->SetTitleFont(32, ""); // same for pad title
625  gStyle->SetLabelFont(32, "XYZ"); // same for axis labels
626  gStyle->SetStatFont(32); // same for stat. box
627  gStyle->SetLabelOffset(0.006, "Y"); // default is 0.005
628 }

Member Data Documentation

edm::EDGetTokenT<CSCALCTDigiCollection> CSCTriggerPrimitivesReader::alcts_d_token_
private

Definition at line 180 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

edm::EDGetTokenT<CSCALCTDigiCollection> CSCTriggerPrimitivesReader::alcts_e_token_
private

Definition at line 184 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

const CSCBadChambers* CSCTriggerPrimitivesReader::badChambers_
private
bool CSCTriggerPrimitivesReader::bookedALCTHistos = false
staticprivate

Definition at line 225 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), endJob(), and fillALCTHistos().

bool CSCTriggerPrimitivesReader::bookedCLCTHistos = false
staticprivate

Definition at line 226 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), endJob(), and fillCLCTHistos().

bool CSCTriggerPrimitivesReader::bookedCompHistos = false
staticprivate

Definition at line 230 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compare(), and endJob().

bool CSCTriggerPrimitivesReader::bookedEfficHistos = false
staticprivate
bool CSCTriggerPrimitivesReader::bookedHotWireHistos = false
staticprivate

Definition at line 224 of file CSCTriggerPrimitivesReader.h.

Referenced by bookHotWireHistos(), and HotWires().

bool CSCTriggerPrimitivesReader::bookedLCTMPCHistos = false
staticprivate

Definition at line 228 of file CSCTriggerPrimitivesReader.h.

Referenced by bookLCTMPCHistos(), and fillLCTMPCHistos().

bool CSCTriggerPrimitivesReader::bookedLCTTMBHistos = false
staticprivate

Definition at line 227 of file CSCTriggerPrimitivesReader.h.

Referenced by bookLCTTMBHistos(), endJob(), and fillLCTTMBHistos().

bool CSCTriggerPrimitivesReader::bookedResolHistos = false
staticprivate
bool CSCTriggerPrimitivesReader::checkBadChambers_
private
edm::EDGetTokenT<CSCCLCTDigiCollection> CSCTriggerPrimitivesReader::clcts_d_token_
private

Definition at line 181 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

edm::EDGetTokenT<CSCCLCTDigiCollection> CSCTriggerPrimitivesReader::clcts_e_token_
private

Definition at line 185 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

edm::EDGetTokenT<CSCComparatorDigiCollection> CSCTriggerPrimitivesReader::compDigi_token_
private

Definition at line 178 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader(), and MCStudies().

edm::InputTag CSCTriggerPrimitivesReader::compDigiProducer_
private

Definition at line 174 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader(), and MCStudies().

const string CSCTriggerPrimitivesReader::csc_type
staticprivate
Initial value:
= {
"ME1/1", "ME1/2", "ME1/3", "ME1/A", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"}

Definition at line 207 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), bookEfficHistos(), bookResolHistos(), drawALCTHistos(), drawCLCTHistos(), drawEfficHistos(), drawHistosForTalks(), drawLCTMPCHistos(), drawLCTTMBHistos(), and endJob().

const string CSCTriggerPrimitivesReader::csc_type_minus
staticprivate
Initial value:
= {
"ME-1/1", "ME-1/2", "ME-1/3", "ME-1/A", "ME-2/1", "ME-2/2", "ME-3/1", "ME-3/2", "ME-4/1", "ME-4/2"}

Definition at line 209 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), bookCLCTHistos(), bookCompHistos(), and bookLCTTMBHistos().

const string CSCTriggerPrimitivesReader::csc_type_plus
staticprivate
Initial value:
= {
"ME+1/1", "ME+1/2", "ME+1/3", "ME+1/A", "ME+2/1", "ME+2/2", "ME+3/1", "ME+3/2", "ME+4/1", "ME+4/2"}

Definition at line 208 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), bookCLCTHistos(), bookCompHistos(), and bookLCTTMBHistos().

bool CSCTriggerPrimitivesReader::dataIsAnotherMC_
private
bool CSCTriggerPrimitivesReader::dataLctsIn_
private

Definition at line 157 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

bool CSCTriggerPrimitivesReader::debug
private
bool CSCTriggerPrimitivesReader::emulLctsIn_
private

Definition at line 158 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

int CSCTriggerPrimitivesReader::Event_
private
TTree* CSCTriggerPrimitivesReader::event_tree[6]
private
int CSCTriggerPrimitivesReader::eventsAnalyzed
private
bool CSCTriggerPrimitivesReader::gangedME1a
private

Definition at line 160 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader(), and doesALCTCrossCLCT().

const CSCGeometry* CSCTriggerPrimitivesReader::geom_
private
TH1F * CSCTriggerPrimitivesReader::hAlctAccel
private

Definition at line 320 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctBXN
private

Definition at line 321 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F * CSCTriggerPrimitivesReader::hAlctCollis
private

Definition at line 320 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctCompFound
private

Definition at line 347 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompFound2
private

Definition at line 348 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompFound2i
private

Definition at line 350 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompFound2x
private

Definition at line 349 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH1F* CSCTriggerPrimitivesReader::hAlctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 408 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareALCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctCompMatch
private

Definition at line 357 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompMatch2
private

Definition at line 358 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompMatch2i
private

Definition at line 360 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompMatch2x
private

Definition at line 359 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH1F* CSCTriggerPrimitivesReader::hAlctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 411 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareALCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctCompSameN
private

Definition at line 352 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos().

TH2F* CSCTriggerPrimitivesReader::hAlctCompSameN2
private

Definition at line 353 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompSameN2i
private

Definition at line 355 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompSameN2x
private

Definition at line 354 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH1F* CSCTriggerPrimitivesReader::hAlctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 409 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareALCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctCompTotal
private

Definition at line 362 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompTotal2
private

Definition at line 363 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompTotal2i
private

Definition at line 365 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH2F* CSCTriggerPrimitivesReader::hAlctCompTotal2x
private

Definition at line 364 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareALCTs().

TH1F* CSCTriggerPrimitivesReader::hAlctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 410 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareALCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 319 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F * CSCTriggerPrimitivesReader::hAlctKeyGroup
private

Definition at line 320 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctKeyGroupME11
private

Definition at line 447 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), and fillALCTHistos().

TH1F * CSCTriggerPrimitivesReader::hAlctPerChamber
private

Definition at line 318 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F * CSCTriggerPrimitivesReader::hAlctPerCSC
private

Definition at line 318 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctPerEvent
private

Definition at line 318 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F * CSCTriggerPrimitivesReader::hAlctQuality
private

Definition at line 320 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctValid
private

Definition at line 320 of file CSCTriggerPrimitivesReader.h.

Referenced by bookALCTHistos(), drawALCTHistos(), and fillALCTHistos().

TH1F* CSCTriggerPrimitivesReader::hAlctVsEta[MAX_STATIONS]
private

Definition at line 427 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH1F* CSCTriggerPrimitivesReader::hClctBendCsc[CSC_TYPES][2]
private

Definition at line 328 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), drawCLCTHistos(), and fillCLCTHistos().

TH1F* CSCTriggerPrimitivesReader::hClctBXN
private

Definition at line 326 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), drawCLCTHistos(), and fillCLCTHistos().

TH1F * CSCTriggerPrimitivesReader::hClctCFEB
private
TH1F* CSCTriggerPrimitivesReader::hClctCompFound
private

Definition at line 367 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos().

TH2F* CSCTriggerPrimitivesReader::hClctCompFound2
private

Definition at line 368 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH2F* CSCTriggerPrimitivesReader::hClctCompFound2i
private

Definition at line 370 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH2F* CSCTriggerPrimitivesReader::hClctCompFound2x
private

Definition at line 369 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH1F* CSCTriggerPrimitivesReader::hClctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 413 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareCLCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hClctCompMatch
private

Definition at line 376 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos().

TH2F* CSCTriggerPrimitivesReader::hClctCompMatch2
private

Definition at line 377 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH2F* CSCTriggerPrimitivesReader::hClctCompMatch2i
private

Definition at line 379 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH2F* CSCTriggerPrimitivesReader::hClctCompMatch2x
private

Definition at line 378 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH1F* CSCTriggerPrimitivesReader::hClctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 416 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareCLCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hClctCompSameN
private

Definition at line 371 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos().

TH2F* CSCTriggerPrimitivesReader::hClctCompSameN2
private

Definition at line 372 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH2F* CSCTriggerPrimitivesReader::hClctCompSameN2i
private

Definition at line 374 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH2F* CSCTriggerPrimitivesReader::hClctCompSameN2x
private

Definition at line 373 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH1F* CSCTriggerPrimitivesReader::hClctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 414 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareCLCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hClctCompTotal
private

Definition at line 381 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos().

TH2F* CSCTriggerPrimitivesReader::hClctCompTotal2
private

Definition at line 382 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH2F* CSCTriggerPrimitivesReader::hClctCompTotal2i
private

Definition at line 384 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH2F* CSCTriggerPrimitivesReader::hClctCompTotal2x
private

Definition at line 383 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareCLCTs().

TH1F* CSCTriggerPrimitivesReader::hClctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 415 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareCLCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hClctCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 324 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), drawCLCTHistos(), and fillCLCTHistos().

TH1F* CSCTriggerPrimitivesReader::hClctKeyStrip[2]
private
TH1F * CSCTriggerPrimitivesReader::hClctKeyStripCsc[CSC_TYPES]
private

Definition at line 328 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), and fillCLCTHistos().

TH1F* CSCTriggerPrimitivesReader::hClctKeyStripME11
private

Definition at line 448 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), and fillCLCTHistos().

TH1F * CSCTriggerPrimitivesReader::hClctPattern[2]
private
TH1F * CSCTriggerPrimitivesReader::hClctPerChamber
private

Definition at line 323 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), drawCLCTHistos(), and fillCLCTHistos().

TH1F * CSCTriggerPrimitivesReader::hClctPerCSC
private

Definition at line 323 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), drawCLCTHistos(), and fillCLCTHistos().

TH1F* CSCTriggerPrimitivesReader::hClctPerEvent
private

Definition at line 323 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), drawCLCTHistos(), and fillCLCTHistos().

TH1F * CSCTriggerPrimitivesReader::hClctQuality
private
TH1F * CSCTriggerPrimitivesReader::hClctSign
private
TH1F * CSCTriggerPrimitivesReader::hClctStripType
private
TH1F* CSCTriggerPrimitivesReader::hClctValid
private

Definition at line 325 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), drawCLCTHistos(), and fillCLCTHistos().

TH1F* CSCTriggerPrimitivesReader::hClctVsPhi[MAX_STATIONS]
private

Definition at line 435 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH1F * CSCTriggerPrimitivesReader::hCorrLctMPCPerCSC
private
TH1F * CSCTriggerPrimitivesReader::hCorrLctTMBPerCSC
private
TH1F* CSCTriggerPrimitivesReader::hEfficALCTEta[MAX_STATIONS]
private

Definition at line 443 of file CSCTriggerPrimitivesReader.h.

Referenced by bookEfficHistos(), calcEfficiency(), and drawEfficHistos().

TH1F* CSCTriggerPrimitivesReader::hEfficALCTEtaCsc[CSC_TYPES]
private
TH1F * CSCTriggerPrimitivesReader::hEfficCLCTEta[MAX_STATIONS]
private

Definition at line 443 of file CSCTriggerPrimitivesReader.h.

Referenced by bookEfficHistos(), calcEfficiency(), and drawEfficHistos().

TH1F * CSCTriggerPrimitivesReader::hEfficCLCTEtaCsc[CSC_TYPES]
private
TH1F* CSCTriggerPrimitivesReader::hEfficHitsEta[MAX_STATIONS]
private

Definition at line 442 of file CSCTriggerPrimitivesReader.h.

Referenced by bookEfficHistos(), calcEfficiency(), and drawEfficHistos().

TH1F* CSCTriggerPrimitivesReader::hEfficHitsEtaCsc[CSC_TYPES]
private
TH1F* CSCTriggerPrimitivesReader::hEtaDiffCsc[CSC_TYPES][3]
private

Definition at line 429 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH1F* CSCTriggerPrimitivesReader::hEtaDiffVsEta[MAX_STATIONS]
private

Definition at line 428 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH2F* CSCTriggerPrimitivesReader::hEtaDiffVsWireCsc[CSC_TYPES]
private

Definition at line 430 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH2F* CSCTriggerPrimitivesReader::hEtaRecVsSim
private

Definition at line 425 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH1F * CSCTriggerPrimitivesReader::hHotCham1
private

Definition at line 315 of file CSCTriggerPrimitivesReader.h.

Referenced by bookHotWireHistos(), and HotWires().

TH1F* CSCTriggerPrimitivesReader::hHotWire1
private

Definition at line 315 of file CSCTriggerPrimitivesReader.h.

Referenced by bookHotWireHistos(), and HotWires().

TH1F* CSCTriggerPrimitivesReader::hLCTCompFound
private

Definition at line 386 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos().

TH2F* CSCTriggerPrimitivesReader::hLCTCompFound2
private

Definition at line 387 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH2F* CSCTriggerPrimitivesReader::hLCTCompFound2i
private

Definition at line 389 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH2F* CSCTriggerPrimitivesReader::hLCTCompFound2x
private

Definition at line 388 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH1F* CSCTriggerPrimitivesReader::hLctCompFoundCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 418 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareLCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hLCTCompMatch
private

Definition at line 396 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos().

TH2F* CSCTriggerPrimitivesReader::hLCTCompMatch2
private

Definition at line 397 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH2F* CSCTriggerPrimitivesReader::hLCTCompMatch2i
private

Definition at line 399 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH2F* CSCTriggerPrimitivesReader::hLCTCompMatch2x
private

Definition at line 398 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH1F* CSCTriggerPrimitivesReader::hLctCompMatchCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 421 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareLCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hLCTCompSameN
private

Definition at line 391 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos().

TH2F* CSCTriggerPrimitivesReader::hLCTCompSameN2
private

Definition at line 392 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH2F* CSCTriggerPrimitivesReader::hLCTCompSameN2i
private

Definition at line 394 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH2F* CSCTriggerPrimitivesReader::hLCTCompSameN2x
private

Definition at line 393 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH1F* CSCTriggerPrimitivesReader::hLctCompSameNCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 419 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareLCTs(), and drawCompHistos().

TH1F* CSCTriggerPrimitivesReader::hLCTCompTotal
private

Definition at line 401 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos().

TH2F* CSCTriggerPrimitivesReader::hLCTCompTotal2
private

Definition at line 402 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH2F* CSCTriggerPrimitivesReader::hLCTCompTotal2i
private

Definition at line 404 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH2F* CSCTriggerPrimitivesReader::hLCTCompTotal2x
private

Definition at line 403 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), and compareLCTs().

TH1F* CSCTriggerPrimitivesReader::hLctCompTotalCsc[MAX_ENDCAPS][CSC_TYPES]
private

Definition at line 420 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCompHistos(), compareLCTs(), and drawCompHistos().

TH1F * CSCTriggerPrimitivesReader::hLctMPCBend
private
TH1F * CSCTriggerPrimitivesReader::hLctMPCBXN
private
TH1F* CSCTriggerPrimitivesReader::hLctMPCChamber[MAX_STATIONS]
private
TH1F* CSCTriggerPrimitivesReader::hLctMPCEndcap
private
TH1F * CSCTriggerPrimitivesReader::hLctMPCKeyGroup
private
TH1F* CSCTriggerPrimitivesReader::hLctMPCKeyGroupME11
private

Definition at line 451 of file CSCTriggerPrimitivesReader.h.

Referenced by bookLCTMPCHistos(), and fillLCTMPCHistos().

TH1F* CSCTriggerPrimitivesReader::hLctMPCKeyStrip
private
TH1F* CSCTriggerPrimitivesReader::hLctMPCKeyStripME11
private

Definition at line 452 of file CSCTriggerPrimitivesReader.h.

Referenced by bookLCTMPCHistos(), and fillLCTMPCHistos().

TH1F* CSCTriggerPrimitivesReader::hLctMPCPattern
private
TH1F * CSCTriggerPrimitivesReader::hLctMPCPerCSC
private
TH1F* CSCTriggerPrimitivesReader::hLctMPCPerEvent
private
TH1F * CSCTriggerPrimitivesReader::hLctMPCQuality
private
TH1F * CSCTriggerPrimitivesReader::hLctMPCRing
private
TH1F * CSCTriggerPrimitivesReader::hLctMPCSector
private
TH1F * CSCTriggerPrimitivesReader::hLctMPCStation
private
TH1F * CSCTriggerPrimitivesReader::hLctMPCStripType
private
TH1F* CSCTriggerPrimitivesReader::hLctMPCValid
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBBend
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBBXN
private
TH1F* CSCTriggerPrimitivesReader::hLctTMBChamber[MAX_STATIONS]
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBCsc[MAX_ENDCAPS][CSC_TYPES]
private
TH1F* CSCTriggerPrimitivesReader::hLctTMBEndcap
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBKeyGroup
private
TH1F* CSCTriggerPrimitivesReader::hLctTMBKeyGroupME11
private

Definition at line 449 of file CSCTriggerPrimitivesReader.h.

Referenced by bookLCTTMBHistos(), and fillLCTTMBHistos().

TH1F* CSCTriggerPrimitivesReader::hLctTMBKeyStrip
private
TH1F* CSCTriggerPrimitivesReader::hLctTMBKeyStripME11
private

Definition at line 450 of file CSCTriggerPrimitivesReader.h.

Referenced by bookLCTTMBHistos(), and fillLCTTMBHistos().

TH1F* CSCTriggerPrimitivesReader::hLctTMBPattern
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBPerChamber
private
TH1F* CSCTriggerPrimitivesReader::hLctTMBPerCSC
private
TH1F* CSCTriggerPrimitivesReader::hLctTMBPerEvent
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBQuality
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBRing
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBSector
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBStation
private
TH1F * CSCTriggerPrimitivesReader::hLctTMBStripType
private
TH1F* CSCTriggerPrimitivesReader::hLctTMBValid
private
TH1F* CSCTriggerPrimitivesReader::hPhiDiffCsc[CSC_TYPES][5]
private
TH1F* CSCTriggerPrimitivesReader::hPhiDiffPattern[CSCConstants::NUM_CLCT_PATTERNS]
private

Definition at line 440 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH1F* CSCTriggerPrimitivesReader::hPhiDiffVsPhi[MAX_STATIONS]
private

Definition at line 436 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH2F* CSCTriggerPrimitivesReader::hPhiDiffVsStripCsc[CSC_TYPES][2]
private

Definition at line 438 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH2F* CSCTriggerPrimitivesReader::hPhiRecVsSim
private

Definition at line 432 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH1F * CSCTriggerPrimitivesReader::hResolDeltaDS
private
TH1F * CSCTriggerPrimitivesReader::hResolDeltaEta
private

Definition at line 426 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH1F* CSCTriggerPrimitivesReader::hResolDeltaHS
private
TH1F* CSCTriggerPrimitivesReader::hResolDeltaPhi
private

Definition at line 434 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

TH1F * CSCTriggerPrimitivesReader::hResolDeltaPhiDS
private

Definition at line 434 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), and calcResolution().

TH1F * CSCTriggerPrimitivesReader::hResolDeltaPhiHS
private

Definition at line 434 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), and calcResolution().

TH1F* CSCTriggerPrimitivesReader::hResolDeltaWG
private
TH1F* CSCTriggerPrimitivesReader::hTrueBendCsc[CSC_TYPES]
private

Definition at line 439 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), calcResolution(), and drawResolHistos().

std::string CSCTriggerPrimitivesReader::lctProducerData_
private

Definition at line 169 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader().

std::string CSCTriggerPrimitivesReader::lctProducerEmul_
private

Definition at line 171 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader().

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCTriggerPrimitivesReader::lcts_mpc_d_token_
private

Definition at line 183 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCTriggerPrimitivesReader::lcts_mpc_e_token_
private

Definition at line 188 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCTriggerPrimitivesReader::lcts_tmb_d_token_
private

Definition at line 182 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCTriggerPrimitivesReader::lcts_tmb_e_token_
private

Definition at line 187 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

const int CSCTriggerPrimitivesReader::lut_wg_vs_hs_me1a
staticprivate
Initial value:
= {
{0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95},
{0, 95}, {0, 95}, {0, 77}, {0, 61}, {0, 39}, {0, 22}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}}

Definition at line 216 of file CSCTriggerPrimitivesReader.h.

Referenced by doesALCTCrossCLCT().

const int CSCTriggerPrimitivesReader::lut_wg_vs_hs_me1ag
staticprivate
Initial value:
= {
{0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31},
{0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 22}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}}

Definition at line 217 of file CSCTriggerPrimitivesReader.h.

Referenced by doesALCTCrossCLCT().

const int CSCTriggerPrimitivesReader::lut_wg_vs_hs_me1b
staticprivate
Initial value:
= {
{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
{100, 127}, {73, 127}, {47, 127}, {22, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127},
{0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127},
{0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127},
{0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 105}, {0, 93}, {0, 78}, {0, 63}}

Definition at line 215 of file CSCTriggerPrimitivesReader.h.

Referenced by doesALCTCrossCLCT(), and getGlobalPosition().

const int CSCTriggerPrimitivesReader::MAX_HS
staticprivate
Initial value:
= {
128, 160, 128, 96, 160, 160, 160, 160, 160, 160}

Definition at line 212 of file CSCTriggerPrimitivesReader.h.

Referenced by bookCLCTHistos(), bookResolHistos(), and getHsPerRad().

const int CSCTriggerPrimitivesReader::MAX_WG
staticprivate
Initial value:
= {
48, 64, 32, 48, 112, 64, 96, 64, 96, 64}

Definition at line 211 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos().

std::string CSCTriggerPrimitivesReader::mpclctProducerData_
private

Definition at line 170 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader().

const int CSCTriggerPrimitivesReader::NCHAMBERS = {36, 36, 36, 36, 18, 36, 18, 36, 18, 36}
staticprivate
int CSCTriggerPrimitivesReader::numALCT = 0
staticprivate

Definition at line 219 of file CSCTriggerPrimitivesReader.h.

Referenced by endJob(), and fillALCTHistos().

int CSCTriggerPrimitivesReader::numCLCT = 0
staticprivate

Definition at line 220 of file CSCTriggerPrimitivesReader.h.

Referenced by endJob(), and fillCLCTHistos().

int CSCTriggerPrimitivesReader::numLCTMPC = 0
staticprivate

Definition at line 222 of file CSCTriggerPrimitivesReader.h.

Referenced by endJob(), and fillLCTMPCHistos().

int CSCTriggerPrimitivesReader::numLCTTMB = 0
staticprivate

Definition at line 221 of file CSCTriggerPrimitivesReader.h.

Referenced by endJob(), and fillLCTTMBHistos().

TreePerStub CSCTriggerPrimitivesReader::perStub[6]
private
bool CSCTriggerPrimitivesReader::plotME1A
private
bool CSCTriggerPrimitivesReader::plotME42
private
edm::EDGetTokenT<CSCCLCTPreTriggerDigiCollection> CSCTriggerPrimitivesReader::pretrigs_e_token_
private

Definition at line 186 of file CSCTriggerPrimitivesReader.h.

Referenced by analyze(), and CSCTriggerPrimitivesReader().

bool CSCTriggerPrimitivesReader::printps = false
staticprivate

Definition at line 235 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader(), and endJob().

const int CSCTriggerPrimitivesReader::ptype_TMB07
staticprivate
Initial value:
= {
-999, -5, 4, -4, 3, -3, 2, -2, 1, -1, 0}

Definition at line 213 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), and fillCLCTHistos().

std::string CSCTriggerPrimitivesReader::resultsFileNamesPrefix_
private
std::string CSCTriggerPrimitivesReader::rootFileName
private

Definition at line 143 of file CSCTriggerPrimitivesReader.h.

int CSCTriggerPrimitivesReader::RUN_
private
edm::EDGetTokenT<edm::PSimHitContainer> CSCTriggerPrimitivesReader::simHit_token_
private

Definition at line 176 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader(), and MCStudies().

edm::InputTag CSCTriggerPrimitivesReader::simHitProducer_
private

Definition at line 172 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader(), and MCStudies().

TTree* CSCTriggerPrimitivesReader::stub_tree[4]
private
MyStubComparison CSCTriggerPrimitivesReader::stubs_comparison[4]
private
const double CSCTriggerPrimitivesReader::TWOPI = 2. * M_PI
staticprivate

Definition at line 204 of file CSCTriggerPrimitivesReader.h.

Referenced by bookResolHistos(), and getHsPerRad().

edm::EDGetTokenT<CSCWireDigiCollection> CSCTriggerPrimitivesReader::wireDigi_token_
private

Definition at line 177 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader(), HotWires(), and MCStudies().

edm::InputTag CSCTriggerPrimitivesReader::wireDigiProducer_
private

Definition at line 173 of file CSCTriggerPrimitivesReader.h.

Referenced by CSCTriggerPrimitivesReader(), and MCStudies().