38 namespace jptJetAnalysis {
61 const uint32_t&
id)
const;
63 const uint32_t&
id)
const
80 : histogramPath_(config.getParameter<std::
string>(
"HistogramPath")),
81 verbose_(config.getUntrackedParameter<bool>(
"PrintDebugMessages",
false)),
82 writeDQMStore_(config.getUntrackedParameter<bool>(
"WriteDQMStore")),
84 n90HitsMin_(config.getParameter<int>(
"n90HitsMin")),
85 fHPDMax_(config.getParameter<double>(
"fHPDMax")),
86 resEMFMin_(config.getParameter<double>(
"resEMFMin")),
87 correctedPtMin_(config.getParameter<double>(
"correctedPtThreshold")),
88 trackPropagator_(new jptJetAnalysis::TrackPropagatorToCalo),
89 sOverNCalculator_(new jptJetAnalysis::StripSignalOverNoiseCalculator),
90 jetID_(new
reco::helper::JetIDHelper(config.getParameter<edm::
ParameterSet>(
"JetIDParams")))
93 std::ostringstream debugStream;
95 debugStream <<
"Configuration for JPTJetAnalyzer: " << std::endl
97 <<
"\tPrintDebugMessages? " << (
verbose_ ?
"yes" :
"no") << std::endl;
104 std::ostringstream* pDebugStream = (
verbose_ ? &debugStream :
NULL);
184 for (reco::JPTJetCollection::const_iterator iJet = jptJets.begin(); iJet != jptJets.end(); ++iJet) {
185 analyze(event, eventSetup, *iJet, pt1, pt2, pt3, numPV);
212 if ( fabs(rawJet.
eta()) > 2.1)
return;
226 const double pt = jptJet.
pt();
231 }
else if (pt > pt2) {
234 }
else if (pt > pt3) {
241 jetID_->calculate(event,rawCaloJet);
242 }
catch (
const std::bad_cast&) {
244 <<
"Histograms not filled. ";
292 pionsInVertexInCalo,pionsOutVertexInCalo,pionsInVertexOutCalo,rawJet);
294 muonsInVertexInCalo,muonsOutVertexInCalo,muonsInVertexOutCalo,rawJet);
296 electronsInVertexInCalo,electronsOutVertexInCalo,electronsInVertexOutCalo,rawJet);
307 std::ostringstream* pDebugStream)
310 if (!psetContainingConfigPSet.
exists(psetName)) {
315 (*pDebugStream) <<
"Histogram " << configName <<
" config found and loaded" << std::endl;
318 const bool enabled = (pset.
exists(
"Enabled") ? pset.
getParameter<
bool>(
"Enabled") :
true);
322 (*pDebugStream) <<
"\tHistogram: " << configName <<
" Disabled" << std::endl;
325 const unsigned int nBins = (pset.
exists(
"NBins") ? pset.
getParameter<
unsigned int>(
"NBins") : 0);
328 const unsigned int nBinsY = (pset.
exists(
"NBinsY") ? pset.
getParameter<
unsigned int>(
"NBinsY") : 0);
333 (*pDebugStream) <<
"\tHistogram: " << configName <<
"\tEnabled"
334 <<
"\tNBins: " << nBins <<
"\tMin: " << min <<
"\tMax: " <<
max;
335 if (nBinsY) (*pDebugStream) <<
"\tNBinsY: " << nBinsY <<
"\tMinY: " << minY <<
"\tMaxY: " << maxY;
336 (*pDebugStream) << std::endl;
349 std::ostringstream* pDebugStream)
365 std::map<std::string,HistogramConfig>::const_iterator configIterator =
histogramConfig_.find(name);
383 std::map<std::string,HistogramConfig>::const_iterator configIterator =
histogramConfig_.find(name);
402 std::map<std::string,HistogramConfig>::const_iterator configIterator =
histogramConfig_.find(name);
409 TProfile* underlyingRootObject =
new TProfile(name.c_str(),title.c_str(),histoConfig.
nBins,histoConfig.
min,histoConfig.
max);
412 histo->setAxisTitle(yAxisTitle,2);
445 "#Delta R between track direrction at vertex and jet axis (track in cone at calo)",
"#Delta R",dqm);
447 "#Delta R between track direrction at vertex and jet axis (track out of cone at calo)",
"#Delta R",dqm);
449 "#Delta R between track impact point on calo and jet axis (track in cone at vertex)",
"#Delta R",dqm);
451 "#Delta R between track impact point on calo and jet axis (track out of cone at vertex)",
"#Delta R",dqm);
514 histos->
ptVsEtaHisto =
bookProfile(tag+
"TrackPtVsEta",titleTag+
" track p_{T} vs #eta",
"#eta",
"p_{T} /GeV/c",dqm);
548 const double pt = track.
pt();
549 const double phi = track.
phi();
550 const double eta = track.
eta();
563 const double trackDirectionJetDR =
deltaR(rawJet,track);
646 const double pt = (*iInConeTrack)->pt();
652 const double pt = (*iOutOfConeTrack)->pt();
655 if (totalPt)
return inConePt/totalPt;
683 const unsigned int theNBinsY,
const double theMinY,
const double theMaxY)
702 trackDirectionJetDRHisto(
NULL),
703 trackImpactPointJetDRHisto(
NULL)
712 : nTracksHisto(theNTracksHisto),
714 phiHisto(thePhiHisto),
715 etaHisto(theEtaHisto),
718 ptVsEtaHisto(thePtVsEtaHisto),
721 trackDirectionJetDRHisto(theTrackDirectionJetDRHisto),
722 trackImpactPointJetDRHisto(theTrackImpactPointJetDRHisto)
725 namespace jptJetAnalysis {
727 TrackPropagatorToCalo::TrackPropagatorToCalo()
728 : magneticField_(
NULL),
730 magneticFieldCacheId_(0),
731 propagatorCacheId_(0)
738 const uint32_t newMagneticFieldCacheId = magneticFieldRecord.
cacheIdentifier();
741 magneticFieldRecord.
get(magneticFieldHandle);
747 const uint32_t newPropagatorCacheId = trackingComponentsRecord.
cacheIdentifier();
750 trackingComponentsRecord.
get(
"SteppingHelixPropagatorAlong",propagatorHandle);
762 : qualityLabel_(theQualityLabel),
787 noiseRecord.
get(noiseHandle);
796 gainRecord.
get(gainHandle);
803 const uint32_t& detId)
const
807 const uint16_t firstStrip = cluster.
firstStrip();
813 unsigned int nNonZeroStrips = 0;
814 const std::vector<uint8_t>& clusterAmplitudes = cluster.
amplitudes();
815 const std::vector<uint8_t>::const_iterator clusterAmplitudesEnd = clusterAmplitudes.end();
816 const std::vector<uint8_t>::const_iterator clusterAmplitudesBegin = clusterAmplitudes.begin();
817 for (std::vector<uint8_t>::const_iterator iAmp = clusterAmplitudesBegin; iAmp != clusterAmplitudesEnd; ++iAmp) {
818 const uint8_t
adc = *iAmp;
819 const uint16_t strip = iAmp-clusterAmplitudesBegin+firstStrip;
824 if (adc) ++nNonZeroStrips;
825 const double noiseContrib = (stripBad ? 0 : noise/gain);
826 noise2 += noiseContrib*noiseContrib;
828 const double noise =
sqrt(noise2/nNonZeroStrips);
829 if (noise)
return signal/noise;
int adc(sample_type sample)
get the ADC sample (12 bits)
virtual double energy() const GCC11_FINAL
energy
T getParameter(std::string const &) const
unsigned long long cacheIdentifier() const
T getUntrackedParameter(std::string const &, T const &) const
virtual double et() const GCC11_FINAL
transverse energy
MonitorElement * NTracksPerJetHisto_
uint32_t magneticFieldCacheId_
virtual ~JPTJetAnalyzer()
Destructor.
const reco::TrackRefVector & getElecsOutVertexInCalo() const
DQMStore * dqm_
DQMStore. Used to write out to file.
Helper class for grouping histograms belowing to a set of tracks.
Jets made from CaloTowers.
const reco::TrackRefVector & getPionsInVertexOutCalo() const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual double p() const GCC11_FINAL
magnitude of momentum vector
MonitorElement * NTracksPerJetVsJetEtHisto_
void fillTrackHistograms(TrackHistograms &allTracksHistos, TrackHistograms &inCaloInVertexHistos, TrackHistograms &inCaloOutVertexHistos, TrackHistograms &outCaloInVertexHistos, const reco::TrackRefVector &inVertexInCalo, const reco::TrackRefVector &outVertexInCalo, const reco::TrackRefVector &inVertexOutCalo, const reco::Jet &rawJet)
Fill all track histograms.
TrackHistograms inCaloInVertexPionHistograms_
std::vector< JPTJet > JPTJetCollection
collection of CaloJet objects
Helper class to hold the configuration for a histogram.
Base class for all types of Jets.
bool IsStripBad(const uint32_t &detid, const short &strip) const
TrackHistograms allElectronHistograms_
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup, const reco::JPTJet &jptJet, double &pt1, double &pt2, double &pt3, const int numPV)
Do the analysis.
std::auto_ptr< jptJetAnalysis::StripSignalOverNoiseCalculator > sOverNCalculator_
Helper object to calculate strip SoN for tracks.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
TrackHistograms inCaloOutVertexMuonHistograms_
double phi() const
azimuthal angle of momentum vector
const bool verbose_
Create verbose debug messages.
TrackHistograms outCaloInVertexMuonHistograms_
uint16_t firstStrip() const
MonitorElement * InVertexTrackImpactPointJetDRHisto_
std::auto_ptr< reco::helper::JetIDHelper > jetID_
Helper object to calculate jet ID parameters.
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
TrackHistograms inCaloInVertexMuonHistograms_
const_iterator end() const
Termination of iteration.
float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range) const
virtual double pz() const GCC11_FINAL
z coordinate of momentum vector
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
const_iterator begin() const
Initialize an iterator over the RefVector.
void fillSiStripHitSoN(const TrackingRecHit &hit)
MonitorElement * InCaloTrackDirectionJetDRHisto_
const SiStripGain * gain_
JPTJetAnalyzer(const edm::ParameterSet &config)
Constructor.
void bookTrackHistograms(TrackHistograms *histos, const std::string &tag, const std::string &titleTag, MonitorElement *trackDirectionJetDRHisto, MonitorElement *trackImpactPointJetDRHisto, DQMStore *dqm)
Book the histograms for a track.
TrackHistograms inCaloOutVertexElectronHistograms_
static const char * messageLoggerCatregory
String constant for message logger category.
void getConfigForHistogram(const std::string &configName, const edm::ParameterSet &psetContainingConfigPSet, std::ostringstream *pDebugStream=NULL)
Load the config for a hitogram.
void update(const edm::EventSetup &eventSetup)
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
const SiStripNoises * noise_
double eta() const
pseudorapidity of momentum vector
MonitorElement * bookProfile(const std::string &name, const std::string &title, const std::string &xAxisTitle, const std::string &yAxisTitle, DQMStore *dqm)
const T & max(const T &a, const T &b)
MonitorElement * book2DHistogram(const std::string &name, const std::string &title, const std::string &xAxisTitle, const std::string &yAxisTitle, DQMStore *dqm)
MonitorElement * ptVsEtaHisto
Jets made from CaloJets corrected for ZSP and tracks.
double pt() const
track transverse momentum
void bookHistograms(DQMStore *dqm)
Book all histograms.
void fillHistogram(MonitorElement *histogram, const double value)
Fill histogram or profile if it has been booked.
void get(HolderT &iHolder) const
std::auto_ptr< jptJetAnalysis::TrackPropagatorToCalo > trackPropagator_
Helper object to propagate tracks to the calo surface.
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
std::pair< ContainerIterator, ContainerIterator > Range
MonitorElement * OutCaloTrackDirectionJetDRHisto_
static math::XYZPoint propagateTrackToCalorimeter(const reco::Track &fTrack, const MagneticField &fField, const Propagator &fPropagator)
propagating the track to the Calorimeter
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::map< std::string, HistogramConfig > histogramConfig_
Histogram configuration (nBins etc)
StripSignalOverNoiseCalculator(const std::string &theQualityLabel=std::string(""))
TrackHistograms outCaloInVertexPionHistograms_
static float getNoise(uint16_t strip, const Range &range)
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
MonitorElement * JetPhiVsEta_
double deltaR(double eta1, double eta2, double phi1, double phi2)
double operator()(const SiStripCluster &cluster, const uint32_t &id) const
const std::string qualityLabel_
const MagneticField * magneticField_
TrackHistograms outCaloInVertexElectronHistograms_
const reco::TrackRefVector & getPionsInVertexInCalo() const
Tracks.
virtual void endJob()
Finish up a job.
MonitorElement * trackImpactPointJetDRHisto
TrackHistograms allMuonHistograms_
const double correctedPtMin_
XYZPointD XYZPoint
point in space with cartesian internal representation
const Propagator * propagator_
T const * product() const
const Range getRange(const uint32_t &detID) const
double signalOverNoise(const SiStripCluster &cluster, const uint32_t &id) const
TrackHistograms inCaloInVertexElectronHistograms_
const reco::TrackRefVector & getElecsInVertexOutCalo() const
MonitorElement * NTracksPerJetVsJetEtaHisto_
void update(const edm::EventSetup &eventSetup)
const reco::TrackRefVector & getMuonsInVertexOutCalo() const
TrackHistograms allPionHistograms_
uint32_t propagatorCacheId_
const reco::TrackRefVector & getPionsOutVertexInCalo() const
int chargedMultiplicity() const
chargedMultiplicity
TrackHistograms inCaloOutVertexPionHistograms_
std::pair< ContainerIterator, ContainerIterator > Range
void getConfigForTrackHistograms(const std::string &tag, const edm::ParameterSet &psetContainingConfigPSet, std::ostringstream *pDebugStream=NULL)
Load the configs for histograms associated with a set of tracks.
static double findPtFractionInCone(const reco::TrackRefVector &inConeTracks, const reco::TrackRefVector &outOfConeTracks)
Utility function to calculate the fraction of track Pt in cone.
MonitorElement * bookHistogram(const std::string &name, const std::string &title, const std::string &xAxisTitle, DQMStore *dqm)
Book histograms and profiles.
const SiStripApvGain::Range getRange(const uint32_t &detID) const
size_type size() const
Size of the RefVector.
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
const reco::TrackRefVector & getElecsInVertexInCalo() const
MonitorElement * trackDirectionJetDRHisto
DetId geographicalId() const
MonitorElement * nTracksHisto
std::pair< ContainerIterator, ContainerIterator > Range
std::string dqmStoreFileName_
DQM store file name.
const std::string histogramPath_
Path of directory used to store histograms in DQMStore.
const Range getRange(const uint32_t &detID) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
const SiStripQuality * quality_
virtual float pt() const GCC11_FINAL
transverse momentum
math::XYZPoint impactPoint(const reco::Track &track) const
const int n90HitsMin_
Jet ID cuts.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const reco::TrackRefVector & getMuonsInVertexInCalo() const
MonitorElement * OutVertexTrackImpactPointJetDRHisto_
const bool writeDQMStore_
Write DQM store to a file?
MonitorElement * phiHisto
const std::vector< uint8_t > & amplitudes() const
void setCurrentFolder(const std::string &fullpath)
MonitorElement * etaHisto
void fillSiStripSoNForTracks(const reco::TrackRefVector &tracks)
Fill the SoN hisotgram for hits on tracks.
const reco::TrackRefVector & getMuonsOutVertexInCalo() const