27 <<
" event.omtfGpResultsPdfSum.num_elements() " << endl;
43 rootTree =
fs->make<TTree>(
"OMTFHitsTree",
"");
81 ptGenPos =
fs->make<TH1I>(
"ptGenPos",
"ptGenPos, eta at vertex 0.8 - 1.24", 400, 0, 200);
82 ptGenNeg =
fs->make<TH1I>(
"ptGenNeg",
"ptGenNeg, eta at vertex 0.8 - 1.24", 400, 0, 200);
87 const std::shared_ptr<OMTFinput>&,
90 const std::vector<l1t::RegionalMuonCand>& candMuons) {}
93 std::unique_ptr<l1t::RegionalMuonCandBxCollection>& finalCandidates) {
122 LogTrace(
"l1tOmtfEventPrint") <<
"\nDataROOTDumper2::observeEventEnd matchingResults.size() " 123 << matchingResults.size() << std::endl;
126 for (
auto& matchingResult : matchingResults) {
129 if (matchingResult.trackingParticle) {
130 auto trackingParticle = matchingResult.trackingParticle;
141 if (trackingParticle->parentVertex().isNonnull()) {
149 LogTrace(
"l1tOmtfEventPrint") <<
"DataROOTDumper2::observeEventEnd trackingParticle: eventId " 150 << trackingParticle->eventId().event() <<
" pdgId " << std::setw(3)
151 << trackingParticle->pdgId() <<
" trackId " 152 << trackingParticle->g4Tracks().at(0).trackId() <<
" pt " << std::setw(9)
153 << trackingParticle->pt()
154 <<
" eta " << std::setw(9) << trackingParticle->momentum().eta() <<
" phi " 155 << std::setw(9) << trackingParticle->momentum().phi() << std::endl;
163 }
else if (matchingResult.simTrack) {
164 auto simTrack = matchingResult.simTrack;
175 if (!
simTrack->noVertex() && matchingResult.simVertex) {
185 LogTrace(
"l1tOmtfEventPrint") <<
"DataROOTDumper2::observeEventEnd simTrack: eventId " 186 <<
simTrack->eventId().event() <<
" pdgId " << std::setw(3)
188 <<
" pt " << std::setw(9)
190 <<
" eta " << std::setw(9) <<
simTrack->momentum().eta() <<
" phi " << std::setw(9)
191 <<
simTrack->momentum().phi() << std::endl;
234 auto& gpResult = (procMuon->getGpResultUnconstr().getPdfSumUnconstr() > procMuon->getGpResultConstr().getPdfSum())
235 ? procMuon->getGpResultUnconstr()
236 : procMuon->getGpResultConstr();
243 for (
unsigned int iLogicLayer = 0; iLogicLayer < gpResult.getStubResults().size(); ++iLogicLayer) {
244 auto& stubResult = gpResult.getStubResults()[iLogicLayer];
251 if (stubResult.getMuonStub()) {
253 hit.layer = iLogicLayer;
254 hit.quality = stubResult.getMuonStub()->qualityHw;
255 hit.eta = stubResult.getMuonStub()->etaHw;
256 hit.valid = stubResult.getValid();
258 int hitPhi = stubResult.getMuonStub()->phiHw;
260 int phiRefHit = gpResult.getStubResults()[refLayerLogicNum].getMuonStub()->phiHw;
263 hitPhi = stubResult.getMuonStub()->phiBHw;
268 hit.phiDist = hitPhi - phiRefHit;
276 if (
hit.phiDist > 504 ||
hit.phiDist < -512) {
280 <<
" valid " << stubResult.getValid() <<
" !!!!!!!!!!!!!!!!!!!!!!!!" << endl;
293 LogTrace(
"l1tOmtfEventPrint") <<
"DataROOTDumper2::observeEventEnd adding omtfCand : " << std::endl;
294 auto finalCandidate = matchingResult.muonCand;
295 LogTrace(
"l1tOmtfEventPrint") <<
" hwPt " << finalCandidate->hwPt() <<
" hwSign " << finalCandidate->hwSign()
296 <<
" hwQual " << finalCandidate->hwQual() <<
" hwEta " << std::setw(4)
297 << finalCandidate->hwEta() << std::setw(4) <<
" hwPhi " << finalCandidate->hwPhi()
298 <<
" eta " << std::setw(9) << (finalCandidate->hwEta() * 0.010875)
299 <<
" isKilled " << procMuon->isKilled() <<
" tRefLayer " << procMuon->getRefLayer()
300 <<
" RefHitNumber " << procMuon->getRefHitNumber() << std::endl;
303 if (matchingResult.muonCand && matchingResult.procMuon->getPtConstr() >= 0 &&
304 matchingResult.muonCand->hwQual() >= 1) {
312 if (matchingResult.muonCand->trackFinderType() ==
l1t::omtf_neg) {
316 addOmtfCand(matchingResult.procMuon);
320 for (
auto& killedCand : matchingResult.procMuon->getKilledMuons()) {
323 if (killedCand->isKilled() ==
false) {
324 edm::LogVerbatim(
"l1tOmtfEventPrint") <<
" killedCand->isKilled() == false !!!!!!!!";
326 addOmtfCand(killedCand);
331 LogTrace(
"l1tOmtfEventPrint") <<
"DataROOTDumper2::observeEventEnd no matching omtfCand" << std::endl;
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
CandidateSimMuonMatcher * candidateSimMuonMatcher
bool exists(std::string const ¶meterName) const
checks if a parameter exists
virtual double hwEtaToEta(int hwEta) const
center of eta bin
unsigned int omtfFiredLayers
DataROOTDumper2(const edm::ParameterSet &edmCfg, const OMTFConfiguration *omtfConfig, CandidateSimMuonMatcher *candidateSimMuonMatcher)
double hwUPtToGev(int hwPt) const override
Abs< T >::type abs(const T &t)
const std::vector< int > & getRefToLogicNumber() const
double hwPtToGev(int hwPt) const override
uGMT pt scale conversion
unsigned int nTestRefHits() const
std::vector< MatchingResult > getMatchingResults()
void observeProcesorEmulation(unsigned int iProcessor, l1t::tftype mtfType, const std::shared_ptr< OMTFinput > &, const AlgoMuons &algoCandidates, const AlgoMuons &gbCandidates, const std::vector< l1t::RegionalMuonCand > &candMuons) override
std::vector< AlgoMuonPtr > AlgoMuons
std::vector< unsigned long > hits
std::shared_ptr< AlgoMuon > AlgoMuonPtr
const OMTFConfiguration * omtfConfig
void observeEventEnd(const edm::Event &iEvent, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &finalCandidates) override
~DataROOTDumper2() override
bool isBendingLayer(unsigned int iLayer) const override