25 #include "TLorentzVector.h" 59 histname =
"InvariantMass_";
60 invariantMass_ = iBooker.
book1D(histname+AlgoName, histname+AlgoName, MassBin, MassMin, MassMax);
70 histname =
"TrackPtPositive_";
71 TrackPtPositive_ = iBooker.
book1D(histname+AlgoName, histname+AlgoName, TrackPtPositiveBin, TrackPtPositiveMin, TrackPtPositiveMax);
78 histname =
"TrackPtNegative_";
79 TrackPtNegative_ = iBooker.
book1D(histname+AlgoName, histname+AlgoName, TrackPtNegativeBin, TrackPtNegativeMin, TrackPtNegativeMax);
82 histname =
"TrackQuality_";
95 histname =
"SumCharge_";
96 sumCharge_ = iBooker.
book1D(histname+AlgoName, histname+AlgoName, SumChargeBin, SumChargeMin, SumChargeMax);
99 unsigned int TrackCurvatureBin =
conf_.
getParameter<
unsigned int>(
"TrackCurvatureBin");
103 histname =
"TrackCurvature_";
104 TrackCurvature_ = iBooker.
book1D(histname+AlgoName, histname+AlgoName, TrackCurvatureBin, TrackCurvatureMin, TrackCurvatureMax);
114 jetPt_ = iBooker.
book1D(histname+AlgoName, histname+AlgoName, JetPtBin, JetPtMin, JetPtMax);
117 unsigned int MinJetDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinJetDeltaRBin");
121 histname =
"MinJetDeltaR_";
122 minJetDeltaR_ = iBooker.
book1D(histname+AlgoName, histname+AlgoName, MinJetDeltaRBin, MinJetDeltaRMin, MinJetDeltaRMax);
129 unsigned int MinTrackDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinTrackDeltaRBin");
133 histname =
"MinTrackDeltaR_";
134 minTrackDeltaR_ = iBooker.
book1D(histname+AlgoName, histname+AlgoName, MinTrackDeltaRBin, MinTrackDeltaRMin, MinTrackDeltaRMax);
137 unsigned int TrackEfficiencyBin =
conf_.
getParameter<
unsigned int>(
"TrackEfficiencyBin");
141 histname =
"AlCaRecoTrackEfficiency_";
154 histname =
"Hits_ZvsR_";
159 Hits_ZvsR_ = iBooker.
book2D(histname+AlgoName, histname+AlgoName, zBin, -zMax, zMax, rBin, rMin, rMax);
161 histname =
"Hits_XvsY_";
162 Hits_XvsY_ = iBooker.
book2D(histname+AlgoName, histname+AlgoName, rBin, -rMax, rMax, rBin, -rMax, rMax);
165 histname =
"Hits_perDetId_";
189 if (!trackCollection.
isValid()){
190 edm::LogError(
"Alignment")<<
"invalid trackcollection encountered!";
196 if (!trackCollection.
isValid()){
197 edm::LogError(
"Alignment")<<
"invalid reference track-collection encountered!";
204 edm::LogError(
"Alignment")<<
"invalid geometry found in event setup!";
210 edm::LogError(
"Alignment")<<
"invalid magnetic field configuration encountered!";
218 edm::LogError(
"Alignment")<<
"no jet collection found in event!";
226 double sumOfCharges = 0;
227 for( reco::TrackCollection::const_iterator
track = (*trackCollection).begin();
track < (*trackCollection).end(); ++
track ){
231 for(reco::CaloJetCollection::const_iterator itJet = jets->begin(); itJet != jets->end() ; ++itJet) {
242 double minTrackDeltaR = 10;
243 for( reco::TrackCollection::const_iterator track2 = (*trackCollection).begin(); track2 < (*trackCollection).end(); ++track2 ){
245 if(dR < minTrackDeltaR && dR > 1
e-6)
255 GlobalPoint gPoint((*track).vx(), (*track).vy(), (*track).vz());
256 double B = magneticField->
inTesla(gPoint).
z();
257 double curv = -(*track).charge()*0.002998*B/(*track).pt();
260 if( (*track).charge() > 0 )
262 if( (*track).charge() < 0 )
267 sumOfCharges += (*track).charge();
273 if((*trackCollection).size() == 2){
274 TLorentzVector track0((*trackCollection).at(0).px(),(*trackCollection).at(0).py(),(*trackCollection).at(0).pz(),
276 TLorentzVector track1((*trackCollection).at(1).px(),(*trackCollection).at(1).py(),(*trackCollection).at(1).pz(),
277 sqrt(((*trackCollection).at(1).p()*(*trackCollection).at(1).p())+daughterMass_*daughterMass_));
278 TLorentzVector mother = track0+track1;
282 edm::LogInfo(
"Alignment")<<
"wrong number of tracks trackcollection encountered: "<<(*trackCollection).size();
290 if( (*iHit)->isValid() ){
298 double r =
sqrt( globP.x()*globP.x() + globP.y()*globP.y() );
300 r*= globP.y() / fabs( globP.y() );
313 std::vector<int> sortedRawIds;
314 for (std::vector<DetId>::const_iterator iDetId = geometry.
detUnitIds().begin();
315 iDetId != geometry.
detUnitIds().end(); ++iDetId) {
316 sortedRawIds.push_back((*iDetId).rawId());
318 std::sort(sortedRawIds.begin(), sortedRawIds.end());
321 for (std::vector<int>::iterator iRawId = sortedRawIds.begin();
322 iRawId != sortedRawIds.end(); ++iRawId){
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
T getParameter(std::string const &) const
static std::string qualityName(TrackQuality)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
void fillRawIdMap(const TrackerGeometry &geometry)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
#define DEFINE_FWK_MODULE(type)
MonitorElement * TrackQuality_
MonitorElement * minJetDeltaR_
std::map< int, int > binByRawId_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
MonitorElement * invariantMass_
MonitorElement * book1D(Args &&...args)
MonitorElement * TrackPtNegative_
void fillHitmaps(const reco::Track &track, const TrackerGeometry &geometry)
edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
static const std::string B
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
double deltaR(double eta1, double eta2, double phi1, double phi2)
MonitorElement * Hits_perDetId_
void setCurrentFolder(const std::string &fullpath)
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * book2D(Args &&...args)
MonitorElement * TrackCurvature_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
ESHandle< TrackerGeometry > geometry
MonitorElement * minTrackDeltaR_
const TrackerGeomDet * idToDet(DetId) const override
DetId geographicalId() const
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
MonitorElement * TrackPtPositive_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
TkAlCaRecoMonitor(const edm::ParameterSet &)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.