26 #include "TLorentzVector.h"
61 histname =
"InvariantMass_";
72 histname =
"TrackPtPositive_";
80 histname =
"TrackPtNegative_";
84 histname =
"TrackQuality_";
97 histname =
"SumCharge_";
101 unsigned int TrackCurvatureBin =
conf_.
getParameter<
unsigned int>(
"TrackCurvatureBin");
105 histname =
"TrackCurvature_";
119 unsigned int MinJetDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinJetDeltaRBin");
123 histname =
"MinJetDeltaR_";
131 unsigned int MinTrackDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinTrackDeltaRBin");
135 histname =
"MinTrackDeltaR_";
139 unsigned int TrackEfficiencyBin =
conf_.
getParameter<
unsigned int>(
"TrackEfficiencyBin");
143 histname =
"AlCaRecoTrackEfficiency_";
153 histname =
"Hits_ZvsR_";
160 histname =
"Hits_XvsY_";
164 histname =
"Hits_perDetId_";
188 if (!trackCollection.
isValid()){
189 edm::LogError(
"Alignment")<<
"invalid trackcollection encountered!";
195 if (!trackCollection.
isValid()){
196 edm::LogError(
"Alignment")<<
"invalid reference track-collection encountered!";
203 edm::LogError(
"Alignment")<<
"invalid geometry found in event setup!";
209 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 ){
230 double minJetDeltaR = 10;
231 for(reco::CaloJetCollection::const_iterator itJet = jets->begin(); itJet != jets->end() ; ++itJet) {
233 dR =
deltaR((*track),(*itJet));
234 if((*itJet).pt() >
maxJetPt_ && dR < minJetDeltaR)
242 double minTrackDeltaR = 10;
243 for( reco::TrackCollection::const_iterator track2 = (*trackCollection).begin(); track2 < (*trackCollection).end(); ++track2 ){
244 dR =
deltaR((*track),(*track2));
245 if(dR < minTrackDeltaR && dR > 1e-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){
332 if(outputMEsInRootFile){
T getParameter(std::string const &) const
static std::string qualityName(TrackQuality)
edm::InputTag trackProducer_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void fillRawIdMap(const TrackerGeometry &geometry)
TrackQuality
track quality
#define DEFINE_FWK_MODULE(type)
MonitorElement * TrackQuality_
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")
MonitorElement * minJetDeltaR_
std::map< int, int > binByRawId_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
virtual void endJob(void)
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
void fillHitmaps(const reco::Track &track, const TrackerGeometry &geometry)
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double deltaR(double eta1, double eta2, double phi1, double phi2)
MonitorElement * Hits_perDetId_
MonitorElement * TrackCurvature_
ESHandle< TrackerGeometry > geometry
MonitorElement * minTrackDeltaR_
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
DetId geographicalId() const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * TrackPtPositive_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
edm::InputTag referenceTrackProducer_
void setCurrentFolder(const std::string &fullpath)
TkAlCaRecoMonitor(const edm::ParameterSet &)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.