CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Macros | Functions | Variables
readTestVector.cc File Reference
#include <iostream>
#include <iomanip>
#include <fstream>
#include <memory>
#include <map>
#include "DataFormats/L1Trigger/interface/EGamma.h"
#include "DataFormats/L1Trigger/interface/Muon.h"
#include "DataFormats/L1Trigger/interface/Tau.h"
#include "DataFormats/L1Trigger/interface/Jet.h"
#include "DataFormats/L1Trigger/interface/EtSum.h"
#include "L1Trigger/L1TGlobal/src/L1TMenuEditor/L1TriggerMenu.hxx"
#include "FWCore/Utilities/interface/typedefs.h"
#include <boost/program_options.hpp>
#include "TH1.h"
#include "TFile.h"

Go to the source code of this file.

Macros

#define M_PI   3.14159265358979323846
 

Functions

double convertEtaFromHW (int hwEta, double max, double step, int hwMax)
 
double convertPhiFromHW (int hwPhi, double step)
 
double convertPtFromHW (int hwPt, double max, double step)
 
int main (int argc, char **argv)
 
void parseAlgo (std::string algo)
 
void parseEGs (std::vector< std::string > egs, bool verbose)
 
void parseEtSums (std::vector< std::string > etsums, bool verbose)
 
void parseJets (std::vector< std::string > jets, bool verbose)
 
void parseMuons (std::vector< std::string > muons, bool verbose)
 
void parseTaus (std::vector< std::string > taus, bool verbose)
 
l1t::EGamma unpackEGs (std::string ieg)
 
l1t::EtSum unpackEtSums (std::string ietsum, l1t::EtSum::EtSumType type)
 
l1t::Jet unpackJets (std::string ijet)
 
l1t::Muon unpackMuons (std::string imu)
 
l1t::Tau unpackTaus (std::string itau)
 

Variables

double EtaStepCalo_ = 230
 
double EtaStepMuon_ = 450
 
TH1D * h_l1eg_eta_
 
TH1D * h_l1eg_isolation_
 
TH1D * h_l1eg_num_
 
TH1D * h_l1eg_phi_
 
TH1D * h_l1eg_pt_
 
TH1D * h_l1et_
 
TH1D * h_l1etm_et_
 
TH1D * h_l1etm_phi_
 
TH1D * h_l1ht_
 
TH1D * h_l1htm_et_
 
TH1D * h_l1htm_phi_
 
TH1D * h_l1jet_eta_
 
TH1D * h_l1jet_num_
 
TH1D * h_l1jet_phi_
 
TH1D * h_l1jet_pt_
 
TH1D * h_l1mu_charge_
 
TH1D * h_l1mu_eta_
 
TH1D * h_l1mu_isolation_
 
TH1D * h_l1mu_num_
 
TH1D * h_l1mu_phi_
 
TH1D * h_l1mu_pt_
 
TH1D * h_l1mu_quality_
 
TH1D * h_l1tau_eta_
 
TH1D * h_l1tau_isolation_
 
TH1D * h_l1tau_num_
 
TH1D * h_l1tau_phi_
 
TH1D * h_l1tau_pt_
 
std::vector< int > l1taccepts
 
std::vector< int > l1taccepts_evt
 
std::vector< std::string > l1tnames
 
const int MAX_ALGO_BITS = 512
 
double MaxCaloEta_ = 5.0
 
double MaxEt_ = 2047
 
double MaxJetPt_ = 1023
 
double MaxLepPt_ = 255
 
double MaxMuonEta_ = 2.45
 
double PhiStepCalo_ = 144
 
double PhiStepMuon_ = 576
 
double PtStep_ = 0.5
 
std::string zeroes128 = std::string(128,'0')
 
std::string zeroes16 = std::string(16,'0')
 
std::string zeroes8 = std::string(8,'0')
 

Macro Definition Documentation

#define M_PI   3.14159265358979323846

Definition at line 25 of file readTestVector.cc.

Referenced by GflashTrajectory::_refreshCache(), reco::WMuNuCandidate::acop(), reco::WMuNuCandidatePtr::acop(), gen::Pythia6Gun::addAntiParticle(), fireworks::addCircle(), fireworks::addDashedLine(), fireworks::addDoubleLines(), ALIUtils::addPii(), OpticalObject::addPii(), PixelUnpackingRegions::addRegionLocal(), MuonCSCChamberResidual::addResidual(), TrackDetectorAssociator::addTAMuonSegmentMatch(), heppy::FSRWeightAlgo::alphaRatio(), FSRWeightProducer::alphaRatio(), L1TStage2EMTF::analyze(), QcdHighPtDQM::analyze(), EwkMuDQM::analyze(), EwkMuLumiMonitorDQM::analyze(), L1GctValidation::analyze(), CheckHitPattern::analyze(), TrackParameterAnalyzer::analyze(), DTTrigTest::analyze(), MuonGeometrySVGTemplate::analyze(), EcalSimHitsValidation::analyze(), EcalRecHitsValidation::analyze(), MuonDTDigis::analyze(), TestOutliers::analyze(), EcalDigisValidation::analyze(), FFTJetPileupAnalyzer::analyze(), L1TCSCTF::analyze(), MuonTrackValidator::analyze(), B2GDQM::analyzeAllHad(), B2GDQM::analyzeSemiE(), B2GDQM::analyzeSemiMu(), CSCSegAlgoSK::areHitsCloseInGlobalPhi(), CSCSegAlgoTC::areHitsCloseInGlobalPhi(), FWCaloDataHistProxyBuilder::assertCaloDataSlice(), myFastSimVal::beginJob(), JetValidation::beginJob(), JetPlotsExample< Jet >::beginJob(), JetAnaPythia< Jet >::beginJob(), PFTester::beginJob(), DijetMass< Jet >::beginJob(), PatTrackAnalyzer::beginJob(), WMuNuSelector::beginJob(), L1GctValidation::beginJob(), myJetAna::beginJob(), TrackParameterAnalyzer::beginJob(), MuonCSCSeedFromRecHits::bestEndcapHit(), AlignmentMonitorGeneric::book(), AlignmentMonitorMuonSystemMap1D::book(), QcdHighPtDQM::bookHistograms(), EwkMuDQM::bookHistograms(), L1TCSCTF::bookHistograms(), METAnalyzer::bookMonitorElement(), HiEvtPlaneFlatten::bounds(), HiEvtPlaneFlatten::bounds2(), BremsstrahlungSimulator::brem(), MuonBremsstrahlungSimulator::brem(), FWTauProxyBuilderBase::buildBaseTau(), FWECALDetailViewBuilder::buildCaloData(), FFTJetEFlowSmoother::buildKernelConvolver(), FFTJetPileupProcessor::buildKernelConvolver(), FFTJetPatRecoProducer::buildKernelConvolver(), KDTreeLinkerTrackEcal::buildTree(), KDTreeLinkerTrackHcal::buildTree(), FWMETProxyBuilder::buildViewType(), FWJetProxyBuilder::buildViewType(), L1TMuon::GeometryTranslator::calcDTSpecificPoint(), CSCSectorReceiverLUT::calcGlobalPhiME(), GsfVertexWeightCalculator::calculate(), TwoTrackMinimumDistanceHelixLine::calculate(), pat::CaloIsolationEnergy::calculate(), ClusterShapeAlgo::Calculate_EnergyDepTopology(), ALIUtils::CalculateAngleDimensionFactorFromString(), DTTracoChip::calculateAngles(), JetPlusTrackProducerAA::calculateBGtracksJet(), TBPositionCalc::CalculateCMSPos(), CSCPairResidualsConstraint::calculatePhi(), tkDetUtil::calculatePhiWindow(), CSCEfficiency::chamberCandidates(), AlignmentTwoBodyDecayTrackSelector::checkAcoplanarity(), HLTEgammaL1MatchFilterPairs::CheckL1Matching(), AlignmentTwoBodyDecayTrackSelector::checkMETAcoplanarity(), ParticleKinematicLinearizedTrackState::checkParameters(), PerigeeMultiLTS::checkParameters(), PerigeeLinearizedTrackState::checkParameters(), checkPhiInRange(), PairProductionSimulator::compute(), HFShower::compute(), HDShower::compute(), EMShower::compute(), ParticleKinematicLinearizedTrackState::computeChargedJacobians(), PerigeeLinearizedTrackState::computeChargedJacobians(), GaussianSumUtilities1D::computeMode(), HFCherenkov::computeNbOfPhotons(), HFCherenkov::computeNPE(), HFCherenkov::computeNPEinPMT(), HFCherenkov::computeNPhTrapped(), DTDigitizer::computeTime(), EcalHitMaker::configureGeometry(), LaserAlignment::ConvertAngle(), convertPhiFromHW(), CordicXilinx::CordicXilinx(), JetPlusTrackCorrector::correctAA(), CaloDetIdAssociator::crossedElement(), CSCOverlapsAlignmentAlgorithm::CSCOverlapsAlignmentAlgorithm(), MuonShowerInformationFiller::cscPositionToDets(), AntiElectronIDMVA5::dCrackPhi(), AntiElectronIDMVA6::dCrackPhi(), PhiScaleHelper::deg2rad(), degrees(), delPhi(), TtDilepLRSignalSelObservables::delta(), CachedTrajectory::delta(), PFBenchmarkAlgo::deltaPhi(), HLTHemiDPhiFilter::deltaPhi(), CaloSubdetectorGeometry::deltaPhi(), L1MuonPixelTrackFitter::deltaPhi(), JetVertexMain::DeltaR(), PythiaFilterEMJetHeep::deltaR(), IsoTrackCalib::deltaR(), CalibratableTest::deltaR(), reco::deltaR2(), JetAnalyzer_HeavyIons_matching::deltaRR(), FFTJetProducer::determinePileup(), OpticalObject::diff2pi(), pat::helper::ParametrizationHelper::diffToParameters(), reco::isodeposit::Direction::Direction(), MuonSeedOrcaPatternRecognition::discriminator(), L1MuGMTPhiLUT::dphi(), IsoTrackCalib::dPhi(), IsoTrig::dPhi(), CSCPairResidualsConstraint::dphidzFromTrack(), TrackerMap::drawModule(), MuonShowerInformationFiller::dtPositionToDets(), ALIUtils::dumpDimensions(), EcalTrapezoidParameters::EcalTrapezoidParameters(), L1CaloGeometry::emJetPhiIndex(), CordicXilinx::encodeAngle(), OpticalObject::eq2ang(), LandauFluctuationGenerator::ersatzt(), L1CaloGeometry::etSumPhiIndex(), l1t::CorrCondition::evaluateCondition(), AlignmentMonitorTracksFromTrajectories::event(), KinematicPerigeeConversions::extendedPerigeeFromKinematicParameters(), HcalDDDGeometryLoader::fill(), MTVHistoProducerAlgoForTracker::fill_ResoAndPull_recoTrack_histos(), FWECALDetailViewBuilder::fillData(), MaterialBudgetEcalHistos::fillEndTrack(), HCALRecHitAnalyzer::FillGeometry(), ECALRecHitAnalyzer::FillGeometry(), ApeEstimator::fillHistsForAnalyzerMode(), ApeEstimator::fillHitHistsXForAnalyzerMode(), ApeEstimator::fillHitHistsYForAnalyzerMode(), cms::PileupJPTJetIdAlgo::fillJPTBlock(), ColinearityKinematicConstraintT< Dim >::fillValue(), PFFilter::filter(), PFMETFilter::filter(), WMuNuValidator::filter(), ThirdHitPrediction::findArcIntersection(), EgammaHLTTrackIsolation::findIsoTracks(), EgammaHLTTrackIsolation::findIsoTracksWithoutEle(), L1GctMet::floatingPointAlgo(), PerigeeConversions::ftsToPerigeeParameters(), FWLegoEvePFCandidate::FWLegoEvePFCandidate(), PairProductionSimulator::gbteth(), BremsstrahlungSimulator::gbteth(), MuonBremsstrahlungSimulator::gbteth(), gen::Pythia6JetGun::generateEvent(), gen::Pythia6PtYDistGun::generateEvent(), gen::Py8JetGun::generatePartonsAndHadronize(), LaserBeamsBarrel::GeneratePrimaries(), LaserBeamsTEC1::GeneratePrimaries(), LaserBeamsTEC2::GeneratePrimaries(), HcalGeometry::getCells(), EcalEndcapGeometry::getCells(), CaloSubdetectorGeometry::getCells(), EcalBarrelGeometry::getCells(), TrackFitter::getCharge(), HcalDDDGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), HGCalGeometry::getClosestCellIndex(), RPCSeedrecHitFinder::getdeltaPhifromrecHits(), DetIdAssociator::getDetIdsCloseToAPoint(), FittedEntriesManager::GetDifferentBetweenLasers(), ALIUtils::getDimensionValue(), IsoTrig::getDistInCM(), CastorSD::getEnergyDeposit(), EcalClusterToolsT< noZS >::getEnergyDepTopology(), HcalDDDRecConstants::getEtaPhi(), IsolatedPixelTrackCandidateProducer::GetEtaPhiAtEcal(), IsolatedPixelTrackCandidateL1TProducer::GetEtaPhiAtEcal(), IsoTrig::GetEtaPhiAtEcal(), NtupleManager::GetGlobalAngles(), CSCSectorReceiverLUT::getGlobalPhiValue(), GflashTrajectory::getL2DAtR(), CocoaDBMgr::GetOptAlignInfoFromOptO(), fireworks::getPhiRange(), getPhysicalPhi(), AngleConverter::getProcessorPhi(), ThirdHitPrediction::getRanges(), CachedTrajectory::getWideTrajectory(), l1t::CaloTools::gtPhi(), HcalFlexiHardcodeGeometryLoader::HcalFlexiHardcodeGeometryLoader(), HcalHardcodeGeometryLoader::HcalHardcodeGeometryLoader(), HcalTopology::HcalTopology(), HDRShower::HDRShower(), helicityAngle(), HerwigMaxPtPartonFilter::HerwigMaxPtPartonFilter(), MultiHitGeneratorFromChi2::hitSets(), PixelTripletNoTipGenerator::hitTriplets(), PixelTripletLargeTipGenerator::hitTriplets(), PixelTripletHLTGenerator::hitTriplets(), HLTPhi2METFilter::hltFilter(), HLTEgammaDoubleEtDeltaPhiFilter::hltFilter(), HLTMuonDimuonL3Filter::hltFilter(), HLTMuonTrimuonL3Filter::hltFilter(), HLTMuonDimuonL2FromL1TFilter::hltFilter(), HLTMuonDimuonL2Filter::hltFilter(), HLTExclDiJetFilter< T >::hltFilter(), HLTEgammaDoubleEtPhiFilter::hltFilter(), HLTAcoFilter::hltFilter(), HLTDoublet< T1, T2 >::hltFilter(), L1CaloGeometry::htSumPhiIndex(), WMuNuValidator::init_histograms(), GflashTrajectory::initializeTrajectory(), int2dphi(), int2phi(), reco::helper::VirtualJetProducerHelper::intersection(), DetIdAssociator::iPhi(), MuonMesh::isClusteredWith(), AngleConverter::isCSCCounterClockwise(), L1TMuon::GeometryTranslator::isCSCCounterClockwise(), MuonMesh::isDuplicateOf(), CSCSegAlgoShowering::isHitNearSegment(), CSCSegAlgoSK::isHitNearSegment(), CSCSegAlgoTC::isHitNearSegment(), CSCSegAlgoDF::isHitNearSegment(), pat::helper::ParametrizationHelper::isPhysical(), PerigeeConversions::jacobianCurvilinear2Perigee(), jacobianCurvilinearToCartesian(), PerigeeConversions::jacobianPerigee2Curvilinear(), GlobalTrackQualityProducer::kink(), L1CaloGeometry::L1CaloGeometry(), reco::GsfTrack::lambdaMode(), VoronoiAlgorithm::lp_populate(), main(), CaloTowerHardcodeGeometryLoader::makeCell(), CastorHardcodeGeometryLoader::makeCell(), HFClusterAlgo::makeCluster(), HcalFlexiHardcodeGeometryLoader::makeHECells(), Multi5x5BremRecoveryClusterAlgo::makeIslandSuperClusters(), fireworks::makeRhoPhiSuperCluster(), TrackParameterAnalyzer::match(), ThirdHitPredictionFromCircle::HelixRZ::maxCurvature(), OuterDetCompatibility::maximalLocalDisplacement(), MuonDT13ChamberResidual::MuonDT13ChamberResidual(), MuonResidualsFitter_compute_log_convolution(), MuonResidualsFitter_logGaussPowerTails(), MuonResidualsFitter_logPowerLawTails(), MuonResidualsFitter_logPureGaussian(), MuonResidualsFitter_logPureGaussian2D(), MuonTrackDT13ChamberResidual::MuonTrackDT13ChamberResidual(), AntiElectronIDMVA5::MVAValue(), AntiElectronIDMVA6::MVAValue(), SiPixelFedCablingMapBuilder::myprint(), DetIdAssociator::nearElement(), BeamProfileVtxGenerator::newVertex(), SiStripElectronSeedGenerator::normalPhi(), HcalTopology::nPhiBins(), fftjetcms::JetToPeakDistance::operator()(), fftjetcms::JetConvergenceDistance::operator()(), TtDilepLRSignalSelObservables::operator()(), OuterHitPhiPrediction::operator()(), operator<<(), phi2int(), phi2short(), Phi_0_2pi(), JetUtil::Phi_0_2pi(), Phi_mpi_pi(), JetUtil::Phi_mpi_pi(), reco::helper::CastorJetIDHelper::phiangle(), CastorClusterProducer::phiangle(), pat::PackedCandidate::phiAtVtx(), CSCSegAlgoSK::phiAtZ(), CSCSegAlgoTC::phiAtZ(), HcalTopology::phiBin(), SiStripElectronSeedGenerator::phiDiff(), hitfit::phidiff(), InnerDeltaPhi::phiRange(), TrackerMap::phival(), L1MuBMTrackSegPhi::phiValue(), L1MuDTTrackSegPhi::phiValue(), SiStripRegionCabling::position(), SiStripRegionCabling::positionIndex(), hcalCalib::Process(), l1t::Stage2Layer2DemuxEGAlgoFirmwareImp1::processEvent(), l1t::Stage2Layer2DemuxTauAlgoFirmwareImp1::processEvent(), l1t::Stage2Layer2EtSumAlgorithmFirmwareImp1::processEvent(), l1t::Stage2Layer2JetSumAlgorithmFirmwareImp1::processEvent(), AlignmentMonitorMuonSystemMap1D::processMuonResidualsFromTrack(), CastorFastTowerProducer::produce(), FFTJetEFlowSmoother::produce(), JetPlusTrackProducerAA::produce(), JetCrystalsAssociator::produce(), SelectedElectronFEDListProducer< TEle, TCand >::produce(), BaseParticlePropagator::propagate(), spr::propagateCalo(), cms::MuonTCMETValueMapProducer::propagateTrack(), spr::propagateTrackerEnd(), TCMETAlgo::propagateTrackToCalorimeterFace(), proxim(), PhiScaleHelper::rad2deg(), radiants(), radius(), JetUtil::radius(), CSCChamberFitter::radiusCorrection(), ThirdHitPredictionFromCircle::HelixRZ::rAtZ(), SimG4HcalHitJetFinder::rDist(), CSCEfficiency::recHitSegment_Efficiencies(), reco::reduceRange(), SoftLepton::refineJetAxis(), ParticleKinematicLinearizedTrackState::refittedParamFromEquation(), PerigeeMultiLTS::refittedParamFromEquation(), PerigeeLinearizedTrackState::refittedParamFromEquation(), SiStripRegionCabling::regionDimensions(), CastorSD::rotateUnitID(), RecoTracktoTP::s_lambda(), TPtoRecoTrack::s_lambda(), KDTreeLinkerTrackHcal::searchLinks(), KDTreeLinkerTrackEcal::searchLinks(), MuonIdProducer::sectorPhi(), SeedMultiplicityAnalyzer::SeedMultiplicityAnalyzer(), CastorShowerLibrary::select(), DetIdAssociator::selectAllInACone(), PFElectronAlgo::SetCandidates(), HDRShower::setHit(), PFElectronAlgo::SetIDOutputs(), PFElectronAlgo::SetLinks(), SimpleL1MuGMTCand::setPhi(), HFClusterAlgo::setup(), GenericBenchmark::setup(), short2phi(), WeakEffectsWeightProducer::sigma0_qqbarll(), HelixExtrapolatorToLine2Order::solve3rdOrder(), spin(), ThirdHitPrediction::spinCloser(), l1t::Stage1Layer2EtSumAlgorithmImpHI::Stage1Layer2EtSumAlgorithmImpHI(), l1t::Stage1Layer2EtSumAlgorithmImpHW::Stage1Layer2EtSumAlgorithmImpHW(), VoronoiAlgorithm::subtract_momentum(), LinkByRecHit::testTrackAndClusterByRecHit(), L1MuGMTLFPhiProLUT::TheLookupFunction(), L1MuGMTMIAUPhiPro1LUT::TheLookupFunction(), reco::IsolatedPixelTrackCandidate::towerIndex(), l1t::CaloTools::towerPhi(), l1t::CaloTools::towerPhiSize(), TrackCount::TrackCount(), TrackerStablePhiSort(), TtFullHadSignalSel::TtFullHadSignalSel(), HcalDDDSimConstants::unitPhi(), unsafe_acos07(), unsafe_acos71(), unsafe_asin71(), SiStripElectronAnalyzer::unwrapPhi(), SiStripElectronSeedGenerator::unwrapPhi(), SiStripElectronAlgo::unwrapPhi(), LaserSteppingAction::UserSteppingAction(), ColinearityKinematicConstraint::value(), L1GctHtMissLut::value(), reco::isodeposit::NumCrystalEtaPhiVeto::veto(), reco::isodeposit::RectangularEtaPhiVeto::veto(), VoronoiAlgorithm::voronoi_area_incident(), and VirtualJetProducer::writeJets().

Function Documentation

double convertEtaFromHW ( int  hwEta,
double  max,
double  step,
int  hwMax 
)

Definition at line 641 of file readTestVector.cc.

References eta, and relval_parameters_module::step.

Referenced by parseEGs(), parseJets(), parseMuons(), and parseTaus().

641  {
642  hwMax++;
643  double binWidth = 2*max/step;
644  double eta = ( hwEta<int(hwMax/2+1.001) ) ? double(hwEta)*binWidth+0.5*binWidth : -(double(hwMax-hwEta)*binWidth -0.5*binWidth);
645  return eta;
646 }
double convertPhiFromHW ( int  hwPhi,
double  step 
)

Definition at line 647 of file readTestVector.cc.

References M_PI, and phi().

Referenced by parseEGs(), parseEtSums(), parseJets(), parseMuons(), and parseTaus().

647  {
648  double phi = double(hwPhi)/step * 2 * M_PI;
649  return phi;
650 }
#define M_PI
Geom::Phi< T > phi() const
double convertPtFromHW ( int  hwPt,
double  max,
double  step 
)

Definition at line 635 of file readTestVector.cc.

References bookConverter::max, EnergyCorrector::pt, and relval_parameters_module::step.

Referenced by parseEGs(), parseEtSums(), parseJets(), parseMuons(), and parseTaus().

635  {
636  double pt = double(hwPt) * step;
637  if( pt>max ) pt = max;
638  return pt;
639 }
int main ( int  argc,
char **  argv 
)

Setup histograms

Definition at line 105 of file readTestVector.cc.

References HLT_FULL_cff::algorithm, gather_cfg::cout, EtaStepCalo_, EtaStepMuon_, cppFunctionSkipper::exception, mergeVDriftHistosByStation::file, groupFilesInBlocks::fin, h_l1eg_eta_, h_l1eg_isolation_, h_l1eg_num_, h_l1eg_phi_, h_l1eg_pt_, h_l1et_, h_l1etm_et_, h_l1etm_phi_, h_l1ht_, h_l1htm_et_, h_l1htm_phi_, h_l1jet_eta_, h_l1jet_num_, h_l1jet_phi_, h_l1jet_pt_, h_l1mu_charge_, h_l1mu_eta_, h_l1mu_isolation_, h_l1mu_num_, h_l1mu_phi_, h_l1mu_pt_, h_l1mu_quality_, h_l1tau_eta_, h_l1tau_isolation_, h_l1tau_num_, h_l1tau_phi_, h_l1tau_pt_, jetmet_cfg::histofile, i, cmsHarvester::index, metsig::jet, l1taccepts, l1taccepts_evt, l1tnames, geometryCSVtoXML::line, M_PI, MAX_ALGO_BITS, MaxCaloEta_, MaxEt_, Data_TkAlMuonIsolated_Run2015B_PromptReco_v1_cff::maxEvents, MaxJetPt_, MaxLepPt_, MaxMuonEta_, RPCpg::mu, mergeVDriftHistosByStation::name, NULL, AlCaHLTBitMon_ParallelJobs::options, convertSQLitetoXML_cfg::output, parseAlgo(), parseEGs(), parseEtSums(), parseJets(), parseMuons(), parseTaus(), PhiStepCalo_, PhiStepMuon_, PtStep_, insertMaterial::readXML(), DTTTrigCorrFirst::run, AlCaHLTBitMon_QueryRunRegistry::string, and metsig::tau.

105  {
106  using namespace boost;
107  namespace po = boost::program_options;
108 
109  std::string vector_file;
110  std::string xml_file;
111  std::string histo_file;
112  bool dumpEvents;
113  int maxEvents;
114 
115  po::options_description desc("Main options");
116  desc.add_options()
117  ("vector_file,i", po::value<std::string>(&vector_file)->default_value(""), "Input file")
118  ("menu_file,m", po::value<std::string>(&xml_file)->default_value(""), "Menu file")
119  ("hist_file,o", po::value<std::string>(&histo_file)->default_value(""), "Output histogram file")
120  ("dumpEvents,d", po::value<bool>(&dumpEvents)->default_value(false), "Dump event-by-event information")
121  ("maxEvents,n", po::value<int>(&maxEvents)->default_value(-1), "Number of events (default is all)")
122  ("help,h", "Produce help message")
123  ;
124 
125  po::variables_map vm, vm0;
126 
127  // parse the first time, using only common options and allow unregistered options
128  try{
129  po::store(po::command_line_parser(argc, argv).options(desc).allow_unregistered().run(), vm0);
130  po::notify(vm0);
131  } catch(std::exception &ex) {
132  std::cout << "Invalid options: " << ex.what() << std::endl;
133  std::cout << "Use readTestVector --help to get a list of all the allowed options" << std::endl;
134  return 999;
135  } catch(...) {
136  std::cout << "Unidentified error parsing options." << std::endl;
137  return 1000;
138  }
139 
140  // if help, print help
141  if(vm0.count("help")) {
142  std::cout << "Usage: readTestVector [options]\n";
143  std::cout << desc;
144  return 0;
145  }
146 
147  if( vector_file=="" ){
148  std::cout << "No input file specified" << std::endl;
149  return 99;
150  }
151 
152  bool readXML = true;
153  if( xml_file=="" ){
154  readXML = false;
155  std::cout << "No menu file specified" << std::endl;
156  }
157 
158  bool output = true;
159  if( histo_file=="" ){
160  output = false;
161  }
162 
163  TFile* histofile = NULL;
164  if( output ){
165  histofile = new TFile(histo_file.c_str(),"RECREATE");
166  histofile->cd();
167  }
168 
169  l1taccepts.resize(MAX_ALGO_BITS);
171  for( unsigned int i=0; i<l1taccepts.size(); i++ ) l1taccepts[i] = 0;
172 
173  if( readXML ){
174  // Load XML.
175  std::auto_ptr<l1t::L1TriggerMenu> tm(l1t::l1TriggerMenu(xml_file));
176 
177  l1tnames.resize(MAX_ALGO_BITS);
178  l1t::AlgorithmList algorithms = tm->algorithms();
179  for( l1t::AlgorithmList::algorithm_const_iterator i = algorithms.algorithm().begin();
180  i != algorithms.algorithm().end(); ++i ){
181 
182  l1t::Algorithm algorithm = (*i);
183 
184  int index = algorithm.index();
185  std::string name = algorithm.name();
186 
187  l1tnames[index] = name;
188  }
189  }
190 
192  h_l1mu_pt_ = new TH1D("h_l1mu_pt", ";L1 #mu p_{T}", int((MaxLepPt_+PtStep_)/(PtStep_) + 1.001), 0, MaxLepPt_+PtStep_ );
193  h_l1mu_eta_ = new TH1D("h_l1mu_eta",";L1 #mu #eta", int(EtaStepMuon_/2+0.0001), -MaxMuonEta_, MaxMuonEta_ );
194  h_l1mu_phi_ = new TH1D("h_l1mu_phi",";L1 #mu #phi", PhiStepMuon_+1, 0, 2*M_PI );
195  h_l1mu_charge_ = new TH1D("h_l1mu_charge_",";L1 #mu charge", 2, 0, 2 );
196  h_l1mu_quality_ = new TH1D("h_l1mu_quality_",";L1 #mu quality", 16, 0, 16 );
197  h_l1mu_isolation_ = new TH1D("h_l1mu_isolation_",";L1 #mu isolation", 4, 0, 4 );
198  h_l1mu_num_ = new TH1D("h_l1mu_num",";L1 Number of #mu", 10, 0, 10 );
199 
200  h_l1jet_pt_ = new TH1D("h_l1jet_pt", ";L1 jet p_{T}", int((MaxJetPt_+PtStep_)/(4*PtStep_) + 1.001), 0, MaxJetPt_+PtStep_ );
201  h_l1jet_eta_ = new TH1D("h_l1jet_eta",";L1 jet #eta", int(EtaStepCalo_/2+0.0001), -MaxCaloEta_, MaxCaloEta_ );
202  h_l1jet_phi_ = new TH1D("h_l1jet_phi",";L1 jet #phi", PhiStepCalo_+1, 0, 2*M_PI );
203  h_l1jet_num_ = new TH1D("h_l1jet_num",";L1 Number of jets", 13, 0, 13 );
204 
205  h_l1eg_pt_ = new TH1D("h_l1eg_pt", ";L1 EG p_{T}", int((MaxLepPt_+PtStep_)/(PtStep_) + 1.001), 0, MaxLepPt_+PtStep_ );
206  h_l1eg_eta_ = new TH1D("h_l1eg_eta",";L1 EG #eta", int(EtaStepCalo_/2+0.0001), -MaxCaloEta_, MaxCaloEta_ );
207  h_l1eg_phi_ = new TH1D("h_l1eg_phi",";L1 EG #phi", PhiStepCalo_+1, 0, 2*M_PI );
208  h_l1eg_isolation_ = new TH1D("h_l1eg_isolation_",";L1 EG isolation", 4, 0, 4 );
209  h_l1eg_num_ = new TH1D("h_l1eg_num",";L1 Number of EGs", 13, 0, 13 );
210 
211  h_l1tau_pt_ = new TH1D("h_l1tau_pt", ";L1 #tau p_{T}", int((MaxLepPt_+PtStep_)/(PtStep_) + 1.001), 0, MaxLepPt_+PtStep_ );
212  h_l1tau_eta_ = new TH1D("h_l1tau_eta",";L1 #tau #eta", int(EtaStepCalo_/2+0.0001), -MaxCaloEta_, MaxCaloEta_ );
213  h_l1tau_phi_ = new TH1D("h_l1tau_phi",";L1 #tau #phi", PhiStepCalo_+1, 0, 2*M_PI );
214  h_l1tau_isolation_ = new TH1D("h_l1tau_isolation_",";L1 #tau isolation", 4, 0, 4 );
215  h_l1tau_num_ = new TH1D("h_l1tau_num",";L1 Number of #tau", 13, 0, 13 );
216 
217  h_l1ht_ = new TH1D("h_l1ht_", ";L1 #SigmaH_{T}", int((MaxEt_+PtStep_)/(16*PtStep_) + 1.001), 0, MaxEt_+PtStep_ );
218  h_l1et_ = new TH1D("h_l1et_", ";L1 #SigmaE_{T}", int((MaxEt_+PtStep_)/(16*PtStep_) + 1.001), 0, MaxEt_+PtStep_ );
219  h_l1htm_et_ = new TH1D("h_l1htm_et_", ";L1 Missing H_{T}", int((MaxEt_+PtStep_)/(16*PtStep_) + 1.001), 0, MaxEt_+PtStep_ );
220  h_l1etm_et_ = new TH1D("h_l1etm_et_", ";L1 Missing E_{T}", int((MaxEt_+PtStep_)/(16*PtStep_) + 1.001), 0, MaxEt_+PtStep_ );
221  h_l1htm_phi_ = new TH1D("h_l1htm_phi_", ";L1 Missing H_{T} #phi", PhiStepCalo_+1, 0, 2*M_PI );
222  h_l1etm_phi_ = new TH1D("h_l1etm_phi_", ";L1 Missing E_{T} #phi", PhiStepCalo_+1, 0, 2*M_PI );
223 
224 
225  std::ifstream file(vector_file);
227 
228  std::vector<std::string> mu;
229  std::vector<std::string> eg;
230  std::vector<std::string> tau;
231  std::vector<std::string> jet;
232  std::vector<std::string> etsum;
233  mu.resize(8);
234  eg.resize(12);
235  tau.resize(8);
236  jet.resize(12);
237  etsum.resize(4);
238 
239  std::string bx, ex, alg, fin;
240 
241  int evt=0;
242  int l1a=0;
243 
244  if( dumpEvents ) printf(" ==== Objects ===\n");
245 
246  while(std::getline(file, line)){
247  evt++;
248  std::stringstream linestream(line);
249  linestream >> bx
250  >> mu[0] >> mu[1] >> mu[2] >> mu[3] >> mu[4] >> mu[5] >> mu[6] >> mu[7]
251  >> eg[0] >> eg[1] >> eg[2] >> eg[3] >> eg[4] >> eg[5] >> eg[6] >> eg[7] >> eg[8] >> eg[9] >> eg[10] >> eg[11]
252  >> tau[0] >> tau[1] >> tau[2] >> tau[3] >> tau[4] >> tau[5] >> tau[6] >> tau[7]
253  >> jet[0] >> jet[1] >> jet[2] >> jet[3] >> jet[4] >> jet[5] >> jet[6] >> jet[7] >> jet[8] >> jet[9] >> jet[10] >> jet[11]
254  >> etsum[0] >> etsum[1] >> etsum[2] >> etsum[3]
255  >> ex >> alg >> fin;
256 
257  if( dumpEvents ) printf(" <==== BX = %s ====>\n",bx.c_str());
258  parseMuons(mu, dumpEvents);
259  parseEGs(eg, dumpEvents);
260  parseTaus(tau, dumpEvents);
261  parseJets(jet, dumpEvents);
262  parseEtSums(etsum, dumpEvents);
263 
264  parseAlgo(alg);
265 
266  int finOR = atoi( fin.c_str() );
267  l1a += finOR;
268 
269  if( dumpEvents ){
270  printf(" == Algos ==\n");
271  if( finOR ){
272  printf(" Triggers with non-zero accepts\n");
273  if( readXML && l1tnames.size()>0 ) printf("\t bit\t L1A\t Name\n");
274  else printf("\t bit\t L1A\n");
275 
276  for( int i=0; i<MAX_ALGO_BITS; i++ ){
277  if( l1taccepts_evt[i]>0 ){
278  if( readXML && l1tnames.size()>0 ) printf("\t %d \t %d \t %s\n", i, l1taccepts_evt[i], l1tnames[i].c_str());
279  else printf("\t %d \t %d\n", i, l1taccepts_evt[i] );
280  }
281  }
282  }
283  else{
284  printf("\n No triggers passed\n");
285  }
286  // extra spacing between bx
287  printf("\n\n");
288  }
289 
290  if( evt==maxEvents ) break;
291  }
292 
293  printf(" =========== Summary of results ==========\n");
294  printf(" There were %d L1A out of %d events (%.1f%%)\n", l1a, evt, float(l1a)/float(evt)*100);
295  printf("\n Triggers with non-zero accepts\n");
296  if( readXML && l1tnames.size()>0 ) printf("\t bit\t L1A\t Name\n");
297  else printf("\t bit\t L1A\n");
298 
299  for( int i=0; i<MAX_ALGO_BITS; i++ ){
300  if( l1taccepts[i]>0 ){
301  if( readXML && l1tnames.size()>0 ) printf("\t %d \t %d \t %s\n", i, l1taccepts[i], l1tnames[i].c_str());
302  else printf("\t %d \t %d\n", i, l1taccepts[i] );
303  }
304  }
305 
306  /*
307  printf(" =========== Dump of results ==========\n");
308  for( int i=0; i<MAX_ALGO_BITS; i++ ){
309  printf("%d\n", l1taccepts[i]);
310  }
311  */
312 
313 
314  /*
315  int NSet=13;
316  printf("# <algo_id>");
317  for( int iSet=0; iSet<NSet; iSet++ ){
318  printf(", <set_%d>",iSet+1);
319  }
320  printf("\n");
321 
322  printf("-1");
323  for( int iSet=0; iSet<NSet; iSet++ ){
324  int useSet = 0;
325  if( iSet==0 ) useSet = -3;
326  else if( iSet==1 ) useSet = -2;
327  else useSet = iSet-1;
328  printf(", %d",useSet);
329  }
330  printf("\n");
331 
332  for( int i=0; i<MAX_ALGO_BITS; i++ ){
333  printf("%d",i);
334  for( int iSet=0; iSet<NSet; iSet++ ){
335  int prescale = 1;
336  if( iSet==0 ) prescale = 0;
337  else if( iSet==1 ) prescale = 1;
338  else if( iSet==2 ) prescale = 1;
339  else if( iSet==3 ) prescale = 2;
340  else if( iSet==4 ) prescale = 10;
341  else if( iSet==5 && i<MAX_ALGO_BITS/2 ) prescale = 2;
342  else if( iSet==6 && i>MAX_ALGO_BITS/2 ) prescale = 5;
343  else if( iSet==7 && i%2==0 ) prescale = 3;
344  else if( iSet==8 && i%2==1 ) prescale = 6;
345  else if( iSet==9 && i%3==0 ) prescale = 4;
346  else if( iSet==10 ) prescale = 10;
347  else if( iSet==11 ) prescale = 2;
348  else if( iSet==12 ) prescale = 1;
349 
350  printf(", %d",prescale);
351  }
352  printf("\n");
353  }
354  */
355 
356  if( output ){
357  histofile->Write();
358  histofile->Close();
359  }
360 
361 
362  return 0;
363 }
double MaxEt_
TH1D * h_l1mu_quality_
int i
Definition: DBlmapReader.cc:9
TH1D * h_l1et_
void parseEGs(std::vector< std::string > egs, bool verbose)
TH1D * h_l1eg_eta_
void parseEtSums(std::vector< std::string > etsums, bool verbose)
TH1D * h_l1mu_num_
TH1D * h_l1mu_charge_
void parseMuons(std::vector< std::string > muons, bool verbose)
#define NULL
Definition: scimark2.h:8
std::vector< int > l1taccepts
TH1D * h_l1eg_num_
TH1D * h_l1etm_et_
void parseTaus(std::vector< std::string > taus, bool verbose)
double MaxMuonEta_
TH1D * h_l1mu_pt_
TH1D * h_l1tau_num_
TH1D * h_l1eg_pt_
double MaxJetPt_
double PhiStepCalo_
double EtaStepMuon_
TH1D * h_l1etm_phi_
string histofile
Definition: jetmet_cfg.py:4
TH1D * h_l1ht_
TH1D * h_l1jet_phi_
void parseJets(std::vector< std::string > jets, bool verbose)
TH1D * h_l1mu_isolation_
void parseAlgo(std::string algo)
double PtStep_
double MaxCaloEta_
double PhiStepMuon_
const int mu
Definition: Constants.h:22
TH1D * h_l1tau_eta_
#define M_PI
const int MAX_ALGO_BITS
TH1D * h_l1eg_phi_
TH1D * h_l1jet_pt_
std::vector< int > l1taccepts_evt
TH1D * h_l1tau_pt_
double MaxLepPt_
TH1D * h_l1htm_phi_
tuple argc
Definition: dir2webdir.py:38
TH1D * h_l1jet_eta_
TH1D * h_l1eg_isolation_
tuple cout
Definition: gather_cfg.py:145
TH1D * h_l1tau_phi_
TH1D * h_l1mu_eta_
TH1D * h_l1jet_num_
TH1D * h_l1htm_et_
TH1D * h_l1mu_phi_
std::vector< std::string > l1tnames
TH1D * h_l1tau_isolation_
double EtaStepCalo_
void parseAlgo ( std::string  algo)

Definition at line 520 of file readTestVector.cc.

References accept(), i, recoMuon::in, l1taccepts, l1taccepts_evt, MAX_ALGO_BITS, alignCSCRings::s, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and zeroes128.

Referenced by main().

520  {
521 
522  // clear the algo per event
523  l1taccepts_evt.clear();
525 
526  // Return if no triggers fired
527  if( algo==zeroes128 ) return;
528 
529  std::stringstream ss;
530  std::string s;
531  int pos, algRes, accept;
532 
533  for( int i=0; i<MAX_ALGO_BITS; i++ ){
534  pos = 127 - int( i/4 );
535  std::string in(1,algo[pos]);
536  char* endPtr = (char*) in.c_str();
537  algRes = strtol( in.c_str(), &endPtr, 16 );
538  accept = ( algRes >> (i%4) ) & 1;
539  l1taccepts_evt[i] += accept;
540  l1taccepts[i] += accept;
541  }
542 
543  return;
544 
545 }
int i
Definition: DBlmapReader.cc:9
std::string zeroes128
std::vector< int > l1taccepts
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
const int MAX_ALGO_BITS
std::vector< int > l1taccepts_evt
void parseEGs ( std::vector< std::string >  egs,
bool  verbose 
)

Definition at line 400 of file readTestVector.cc.

References convertEtaFromHW(), convertPhiFromHW(), convertPtFromHW(), eta, EtaStepCalo_, h_l1eg_eta_, h_l1eg_isolation_, h_l1eg_num_, h_l1eg_phi_, h_l1eg_pt_, l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), i, MaxCaloEta_, MaxLepPt_, phi(), PhiStepCalo_, EnergyCorrector::pt, PtStep_, AlCaHLTBitMon_QueryRunRegistry::string, unpackEGs(), and zeroes8.

Referenced by main().

400  {
401 
402  if( verbose) printf(" == EGammas ==\n");
403  int neg=0;
404  for( unsigned int i=0; i<egs.size(); i++ ){
405  std::string ieg = egs[i];
406  if( ieg==zeroes8 ) continue;
407  neg++;
408  l1t::EGamma eg = unpackEGs( ieg );
409 
410  double pt = convertPtFromHW( eg.hwPt(), MaxLepPt_, PtStep_ );
411  double eta = convertEtaFromHW( eg.hwEta(), MaxCaloEta_, EtaStepCalo_, 0xff );
412  double phi = convertPhiFromHW( eg.hwPhi(), PhiStepCalo_ );
413 
414  h_l1eg_pt_->Fill( pt );
415  h_l1eg_eta_->Fill( eta );
416  h_l1eg_phi_->Fill( phi );
417  h_l1eg_isolation_->Fill( eg.hwIso() );
418 
419  if( verbose) printf(" l1t::EGamma %d:\t pt = %d (%.1f),\t eta = %d (%+.2f),\t phi = %d (%.2f),\t iso = %d\n", i, eg.hwPt(), pt, eg.hwEta(), eta, eg.hwPhi(), phi, eg.hwIso());
420  }
421  h_l1eg_num_->Fill(neg);
422 
423  return;
424 }
int i
Definition: DBlmapReader.cc:9
TH1D * h_l1eg_eta_
int hwPhi() const
Definition: L1Candidate.cc:79
TH1D * h_l1eg_num_
int hwIso() const
Definition: L1Candidate.cc:84
TH1D * h_l1eg_pt_
double PhiStepCalo_
double convertPhiFromHW(int hwPhi, double step)
double convertPtFromHW(int hwPt, double max, double step)
double PtStep_
double MaxCaloEta_
int hwEta() const
Definition: L1Candidate.cc:74
TH1D * h_l1eg_phi_
double MaxLepPt_
int hwPt() const
Definition: L1Candidate.cc:69
Geom::Phi< T > phi() const
double convertEtaFromHW(int hwEta, double max, double step, int hwMax)
TH1D * h_l1eg_isolation_
std::string zeroes8
l1t::EGamma unpackEGs(std::string ieg)
double EtaStepCalo_
void parseEtSums ( std::vector< std::string >  etsums,
bool  verbose 
)

Definition at line 474 of file readTestVector.cc.

References convertPhiFromHW(), convertPtFromHW(), h_l1et_, h_l1etm_et_, h_l1etm_phi_, h_l1ht_, h_l1htm_et_, h_l1htm_phi_, l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), L1Analysis::kMissingEt, L1Analysis::kMissingHt, L1Analysis::kTotalEt, L1Analysis::kTotalHt, MaxEt_, phi(), PhiStepCalo_, EnergyCorrector::pt, PtStep_, AlCaHLTBitMon_QueryRunRegistry::string, unpackEtSums(), and zeroes8.

Referenced by main().

474  {
475 
476  if( verbose) printf(" == EtSums ==\n");
477 
478  //et sum
479  std::string iet = etsum[0];
480  if( iet!=zeroes8 ){
482  double pt = convertPtFromHW( et.hwPt(), MaxEt_, PtStep_ );
483  h_l1et_->Fill( pt );
484  if( verbose) printf(" l1t::EtSum TotalEt:\t Et = %d\n", et.hwPt());
485  }
486  //ht sum
487  std::string iht = etsum[1];
488  if( iht!=zeroes8 ){
490  double pt = convertPtFromHW( ht.hwPt(), MaxEt_, PtStep_ );
491  h_l1ht_->Fill( pt );
492  if( verbose) printf(" l1t::EtSum TotalHt:\t Ht = %d\n", ht.hwPt());
493  }
494  //etm
495  std::string ietm = etsum[2];
496  if( ietm!=zeroes8 ){
498  double pt = convertPtFromHW( etm.hwPt(), MaxEt_, PtStep_ );
499  double phi = convertPhiFromHW( etm.hwPhi(), PhiStepCalo_ );
500  h_l1etm_et_->Fill( pt );
501  h_l1etm_phi_->Fill( phi );
502  if( verbose) printf(" l1t::EtSum MissingEt:\t Et = %d,\t phi = %d\n", etm.hwPt(), etm.hwPhi());
503  }
504  //htm
505  std::string ihtm = etsum[3];
506  if( ihtm!=zeroes8 ){
508  double pt = convertPtFromHW( htm.hwPt(), MaxEt_, PtStep_ );
509  double phi = convertPhiFromHW( htm.hwPhi(), PhiStepCalo_ );
510  h_l1htm_et_->Fill( pt );
511  h_l1htm_phi_->Fill( phi );
512  if( verbose) printf(" l1t::EtSum MissingHt:\t Et = %d,\t phi = %d\n", htm.hwPt(), htm.hwPhi());
513  }
514 
515  return;
516 }
double MaxEt_
TH1D * h_l1et_
int hwPhi() const
Definition: L1Candidate.cc:79
TH1D * h_l1etm_et_
double PhiStepCalo_
TH1D * h_l1etm_phi_
l1t::EtSum unpackEtSums(std::string ietsum, l1t::EtSum::EtSumType type)
TH1D * h_l1ht_
double convertPhiFromHW(int hwPhi, double step)
double convertPtFromHW(int hwPt, double max, double step)
double PtStep_
int hwPt() const
Definition: L1Candidate.cc:69
TH1D * h_l1htm_phi_
Geom::Phi< T > phi() const
std::string zeroes8
TH1D * h_l1htm_et_
void parseJets ( std::vector< std::string >  jets,
bool  verbose 
)

Definition at line 450 of file readTestVector.cc.

References convertEtaFromHW(), convertPhiFromHW(), convertPtFromHW(), eta, EtaStepCalo_, h_l1jet_eta_, h_l1jet_num_, h_l1jet_phi_, h_l1jet_pt_, l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), i, metsig::jet, MaxCaloEta_, MaxJetPt_, njet, phi(), PhiStepCalo_, EnergyCorrector::pt, PtStep_, AlCaHLTBitMon_QueryRunRegistry::string, unpackJets(), and zeroes8.

Referenced by main().

450  {
451 
452  if( verbose) printf(" == Jets ==\n");
453  int njet=0;
454  for( unsigned int i=0; i<jets.size(); i++ ){
455  std::string ijet = jets[i];
456  if( ijet==zeroes8 ) continue;
457  njet++;
458  l1t::Jet jet = unpackJets( ijet );
459 
460  double pt = convertPtFromHW( jet.hwPt(), MaxJetPt_, PtStep_ );
461  double eta = convertEtaFromHW( jet.hwEta(), MaxCaloEta_, EtaStepCalo_, 0xff );
462  double phi = convertPhiFromHW( jet.hwPhi(), PhiStepCalo_ );
463 
464  h_l1jet_pt_->Fill( pt );
465  h_l1jet_eta_->Fill( eta );
466  h_l1jet_phi_->Fill( phi );
467 
468  if( verbose) printf(" l1t::Jet %d:\t pt = %d (%.1f),\t eta = %d (%+.2f),\t phi = %d (%.2f)\n", i, jet.hwPt(), pt, jet.hwEta(), eta, jet.hwPhi(), phi);
469  }
470  h_l1jet_num_->Fill(njet);
471 
472  return;
473 }
int i
Definition: DBlmapReader.cc:9
int hwPhi() const
Definition: L1Candidate.cc:79
int njet
Definition: HydjetWrapper.h:95
Definition: Jet.h:16
double MaxJetPt_
double PhiStepCalo_
TH1D * h_l1jet_phi_
vector< PseudoJet > jets
double convertPhiFromHW(int hwPhi, double step)
double convertPtFromHW(int hwPt, double max, double step)
double PtStep_
double MaxCaloEta_
int hwEta() const
Definition: L1Candidate.cc:74
TH1D * h_l1jet_pt_
int hwPt() const
Definition: L1Candidate.cc:69
TH1D * h_l1jet_eta_
Geom::Phi< T > phi() const
double convertEtaFromHW(int hwEta, double max, double step, int hwMax)
std::string zeroes8
l1t::Jet unpackJets(std::string ijet)
TH1D * h_l1jet_num_
double EtaStepCalo_
void parseMuons ( std::vector< std::string >  muons,
bool  verbose 
)

Definition at line 367 of file readTestVector.cc.

References RecoTauCleanerPlugins::charge, convertEtaFromHW(), convertPhiFromHW(), convertPtFromHW(), eta, EtaStepMuon_, h_l1mu_charge_, h_l1mu_eta_, h_l1mu_isolation_, h_l1mu_num_, h_l1mu_phi_, h_l1mu_pt_, h_l1mu_quality_, l1t::Muon::hwCharge(), l1t::Muon::hwChargeValid(), l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), l1t::L1Candidate::hwQual(), i, MaxLepPt_, MaxMuonEta_, RPCpg::mu, phi(), PhiStepMuon_, EnergyCorrector::pt, PtStep_, AlCaHLTBitMon_QueryRunRegistry::string, unpackMuons(), and zeroes16.

Referenced by main().

367  {
368 
369  if( verbose) printf(" == Muons ==\n");
370  int nmu=0;
371  for( unsigned int i=0; i<muons.size(); i++ ){
372  std::string imu = muons[i];
373  if( imu==zeroes16 ) continue;
374  nmu++;
375  l1t::Muon mu = unpackMuons( imu );
376 
377  double pt = convertPtFromHW( mu.hwPt(), MaxLepPt_, PtStep_ );
378  double eta = convertEtaFromHW( mu.hwEta(), MaxMuonEta_, EtaStepMuon_, 0x1ff );
379  double phi = convertPhiFromHW( mu.hwPhi(), PhiStepMuon_ );
380 
381  int iso = mu.hwIso();
382  int qual = mu.hwQual();
383  int charge = mu.hwCharge();
384  int chargeValid = mu.hwChargeValid();
385 
386  h_l1mu_pt_->Fill( pt );
387  h_l1mu_eta_->Fill( eta );
388  h_l1mu_phi_->Fill( phi );
389  h_l1mu_charge_->Fill( charge );
390 
391  h_l1mu_quality_->Fill( qual );
392  h_l1mu_isolation_->Fill( iso );
393 
394  if( verbose) printf(" l1t::Muon %d:\t pt = %d (%.1f),\t eta = %d (%+.2f),\t phi = %d (%.2f),\t iso = %d,\t qual = %d,\t charge = %d,\t chargeValid = %d\n", i, mu.hwPt(), pt, mu.hwEta(), eta, mu.hwPhi(), phi, iso, qual, charge, chargeValid);
395  }
396  h_l1mu_num_->Fill(nmu);
397 
398  return;
399 }
TH1D * h_l1mu_quality_
int i
Definition: DBlmapReader.cc:9
TH1D * h_l1mu_num_
TH1D * h_l1mu_charge_
int hwPhi() const
Definition: L1Candidate.cc:79
double MaxMuonEta_
TH1D * h_l1mu_pt_
int hwIso() const
Definition: L1Candidate.cc:84
l1t::Muon unpackMuons(std::string imu)
double EtaStepMuon_
std::string zeroes16
double convertPhiFromHW(int hwPhi, double step)
double convertPtFromHW(int hwPt, double max, double step)
TH1D * h_l1mu_isolation_
double PtStep_
double PhiStepMuon_
const int mu
Definition: Constants.h:22
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
Definition: Muon.h:16
double MaxLepPt_
int hwPt() const
Definition: L1Candidate.cc:69
Geom::Phi< T > phi() const
tuple muons
Definition: patZpeak.py:38
double convertEtaFromHW(int hwEta, double max, double step, int hwMax)
TH1D * h_l1mu_eta_
int hwChargeValid() const
Definition: Muon.cc:142
TH1D * h_l1mu_phi_
int hwCharge() const
Definition: Muon.cc:136
void parseTaus ( std::vector< std::string >  taus,
bool  verbose 
)

Definition at line 425 of file readTestVector.cc.

References convertEtaFromHW(), convertPhiFromHW(), convertPtFromHW(), eta, EtaStepCalo_, h_l1tau_eta_, h_l1tau_isolation_, h_l1tau_num_, h_l1tau_phi_, h_l1tau_pt_, l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), i, MaxCaloEta_, MaxLepPt_, phi(), PhiStepCalo_, EnergyCorrector::pt, PtStep_, AlCaHLTBitMon_QueryRunRegistry::string, metsig::tau, unpackTaus(), and zeroes8.

Referenced by main().

425  {
426 
427  if( verbose) printf(" == Taus ==\n");
428  int ntau=0;
429  for( unsigned int i=0; i<taus.size(); i++ ){
430  std::string itau = taus[i];
431  if( itau==zeroes8 ) continue;
432  ntau++;
433  l1t::Tau tau = unpackTaus( itau );
434 
435  double pt = convertPtFromHW( tau.hwPt(), MaxLepPt_, PtStep_ );
436  double eta = convertEtaFromHW( tau.hwEta(), MaxCaloEta_, EtaStepCalo_, 0xff );
437  double phi = convertPhiFromHW( tau.hwPhi(), PhiStepCalo_ );
438 
439  h_l1tau_pt_->Fill( pt );
440  h_l1tau_eta_->Fill( eta );
441  h_l1tau_phi_->Fill( phi );
442  h_l1tau_isolation_->Fill( tau.hwIso() );
443 
444  if( verbose) printf(" l1t::Tau %d:\t pt = %d (%.1f),\t eta = %d (%+.2f),\t phi = %d (%.2f),\t iso = %d\n", i, tau.hwPt(), pt, tau.hwEta(), eta, tau.hwPhi(), phi, tau.hwIso());
445  }
446  h_l1tau_num_->Fill(ntau);
447 
448  return;
449 }
int i
Definition: DBlmapReader.cc:9
Definition: Tau.h:16
int hwPhi() const
Definition: L1Candidate.cc:79
TH1D * h_l1tau_num_
int hwIso() const
Definition: L1Candidate.cc:84
double PhiStepCalo_
double convertPhiFromHW(int hwPhi, double step)
double convertPtFromHW(int hwPt, double max, double step)
double PtStep_
double MaxCaloEta_
int hwEta() const
Definition: L1Candidate.cc:74
TH1D * h_l1tau_eta_
TH1D * h_l1tau_pt_
double MaxLepPt_
int hwPt() const
Definition: L1Candidate.cc:69
Geom::Phi< T > phi() const
double convertEtaFromHW(int hwEta, double max, double step, int hwMax)
std::string zeroes8
TH1D * h_l1tau_phi_
l1t::Tau unpackTaus(std::string itau)
TH1D * h_l1tau_isolation_
double EtaStepCalo_
l1t::EGamma unpackEGs ( std::string  ieg)

Definition at line 569 of file readTestVector.cc.

References eta, p4, phi(), and EnergyCorrector::pt.

Referenced by parseEGs().

569  {
570 
571  char* endPtr = (char*) ieg.c_str();
572  unsigned int packedVal = strtol( ieg.c_str(), &endPtr, 16 );
573 
574  int pt = (packedVal>>0) & 0x1ff;
575  int eta = (packedVal>>9) & 0xff;
576  int phi = (packedVal>>17) & 0xff;
577  int iso = (packedVal>>25) & 0x3;
578  int qual= (packedVal>>27) & 0x31;
579 
580  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *p4 = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
581  l1t::EGamma eg(*p4, pt, eta, phi, qual, iso);
582 
583  return eg;
584 }
double p4[4]
Definition: TauolaWrapper.h:92
Geom::Phi< T > phi() const
l1t::EtSum unpackEtSums ( std::string  ietsum,
l1t::EtSum::EtSumType  type 
)

Definition at line 618 of file readTestVector.cc.

References L1Analysis::kMissingEt, L1Analysis::kMissingHt, p4, phi(), and EnergyCorrector::pt.

Referenced by parseEtSums().

618  {
619 
620  char* endPtr = (char*) ietsum.c_str();
621  unsigned int packedVal = strtol( ietsum.c_str(), &endPtr, 16 );
622 
623  int pt = (packedVal>>0) & 0xfff;
624  int phi = 0;
626  type==l1t::EtSum::EtSumType::kMissingHt ) phi = (packedVal>>12) & 0xff;
627 
628  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *p4 = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
629  l1t::EtSum sum(*p4, type, pt, 0,phi, 0);
630 
631  return sum;
632 }
type
Definition: HCALResponse.h:21
double p4[4]
Definition: TauolaWrapper.h:92
Geom::Phi< T > phi() const
l1t::Jet unpackJets ( std::string  ijet)

Definition at line 602 of file readTestVector.cc.

References eta, metsig::jet, p4, phi(), and EnergyCorrector::pt.

Referenced by parseJets().

602  {
603 
604  char* endPtr = (char*) ijet.c_str();
605  unsigned int packedVal = strtol( ijet.c_str(), &endPtr, 16 );
606 
607  int pt = (packedVal>>0) & 0x7ff;
608  int eta = (packedVal>>11) & 0xff;
609  int phi = (packedVal>>19) & 0xff;
610  int qual= (packedVal>>27) & 0x1;
611 
612  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *p4 = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
613  l1t::Jet jet(*p4, pt, eta, phi, qual);
614 
615  return jet;
616 }
Definition: Jet.h:16
double p4[4]
Definition: TauolaWrapper.h:92
Geom::Phi< T > phi() const
l1t::Muon unpackMuons ( std::string  imu)

Definition at line 548 of file readTestVector.cc.

References RecoTauCleanerPlugins::charge, eta, RPCpg::mu, p4, phi(), EnergyCorrector::pt, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by parseMuons().

548  {
549 
550  char* endPtr = (char*) imu.c_str();
551  cms_uint64_t packedVal = strtoull( imu.c_str(), &endPtr, 16 );
552 
553  int pt = (packedVal>>10) & 0x1ff;
554  int eta = (packedVal>>23) & 0x1ff;
555  int phi = (packedVal>>0) & 0x3ff;
556  int iso = (packedVal>>32) & 0x3;
557  int qual= (packedVal>>19) & 0xf;
558  int charge = (packedVal>>34) & 0x1;
559  int chargeValid = (packedVal>>35) & 0x1;
560  int mip = 1;
561  int tag = 1;
562 
563  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *p4 = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
564  l1t::Muon mu(*p4, pt, eta, phi, qual, charge, chargeValid, iso, mip, tag);
565 
566  return mu;
567 
568 }
double p4[4]
Definition: TauolaWrapper.h:92
const int mu
Definition: Constants.h:22
Definition: Muon.h:16
Geom::Phi< T > phi() const
unsigned long long cms_uint64_t
Definition: typedefs.h:17
l1t::Tau unpackTaus ( std::string  itau)

Definition at line 585 of file readTestVector.cc.

References eta, p4, phi(), EnergyCorrector::pt, and metsig::tau.

Referenced by parseTaus().

585  {
586 
587  char* endPtr = (char*) itau.c_str();
588  unsigned int packedVal = strtol( itau.c_str(), &endPtr, 16 );
589 
590  int pt = (packedVal>>0) & 0x1ff;
591  int eta = (packedVal>>9) & 0xff;
592  int phi = (packedVal>>17) & 0xff;
593  int iso = (packedVal>>25) & 0x3;
594  int qual= (packedVal>>27) & 0x31;
595 
596  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *p4 = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
597  l1t::Tau tau(*p4, pt, eta, phi, qual, iso);
598 
599  return tau;
600 }
Definition: Tau.h:16
double p4[4]
Definition: TauolaWrapper.h:92
Geom::Phi< T > phi() const

Variable Documentation

double EtaStepCalo_ = 230
double EtaStepMuon_ = 450

Definition at line 99 of file readTestVector.cc.

Referenced by main(), parseMuons(), and l1t::GenToInputProducer::produce().

TH1D* h_l1eg_eta_

Definition at line 69 of file readTestVector.cc.

Referenced by main(), and parseEGs().

TH1D* h_l1eg_isolation_

Definition at line 71 of file readTestVector.cc.

Referenced by main(), and parseEGs().

TH1D* h_l1eg_num_

Definition at line 72 of file readTestVector.cc.

Referenced by main(), and parseEGs().

TH1D* h_l1eg_phi_

Definition at line 70 of file readTestVector.cc.

Referenced by main(), and parseEGs().

TH1D* h_l1eg_pt_

Definition at line 68 of file readTestVector.cc.

Referenced by main(), and parseEGs().

TH1D* h_l1et_

Definition at line 81 of file readTestVector.cc.

Referenced by main(), and parseEtSums().

TH1D* h_l1etm_et_

Definition at line 83 of file readTestVector.cc.

Referenced by main(), and parseEtSums().

TH1D* h_l1etm_phi_

Definition at line 85 of file readTestVector.cc.

Referenced by main(), and parseEtSums().

TH1D* h_l1ht_

Definition at line 80 of file readTestVector.cc.

Referenced by main(), and parseEtSums().

TH1D* h_l1htm_et_

Definition at line 82 of file readTestVector.cc.

Referenced by main(), and parseEtSums().

TH1D* h_l1htm_phi_

Definition at line 84 of file readTestVector.cc.

Referenced by main(), and parseEtSums().

TH1D* h_l1jet_eta_

Definition at line 64 of file readTestVector.cc.

Referenced by main(), and parseJets().

TH1D* h_l1jet_num_

Definition at line 66 of file readTestVector.cc.

Referenced by main(), and parseJets().

TH1D* h_l1jet_phi_

Definition at line 65 of file readTestVector.cc.

Referenced by main(), and parseJets().

TH1D* h_l1jet_pt_

Definition at line 63 of file readTestVector.cc.

Referenced by main(), and parseJets().

TH1D* h_l1mu_charge_

Definition at line 58 of file readTestVector.cc.

Referenced by main(), and parseMuons().

TH1D* h_l1mu_eta_

Definition at line 56 of file readTestVector.cc.

Referenced by main(), and parseMuons().

TH1D* h_l1mu_isolation_

Definition at line 60 of file readTestVector.cc.

Referenced by main(), and parseMuons().

TH1D* h_l1mu_num_

Definition at line 61 of file readTestVector.cc.

Referenced by main(), and parseMuons().

TH1D* h_l1mu_phi_

Definition at line 57 of file readTestVector.cc.

Referenced by main(), and parseMuons().

TH1D* h_l1mu_pt_

Definition at line 55 of file readTestVector.cc.

Referenced by main(), and parseMuons().

TH1D* h_l1mu_quality_

Definition at line 59 of file readTestVector.cc.

Referenced by main(), and parseMuons().

TH1D* h_l1tau_eta_

Definition at line 75 of file readTestVector.cc.

Referenced by main(), and parseTaus().

TH1D* h_l1tau_isolation_

Definition at line 77 of file readTestVector.cc.

Referenced by main(), and parseTaus().

TH1D* h_l1tau_num_

Definition at line 78 of file readTestVector.cc.

Referenced by main(), and parseTaus().

TH1D* h_l1tau_phi_

Definition at line 76 of file readTestVector.cc.

Referenced by main(), and parseTaus().

TH1D* h_l1tau_pt_

Definition at line 74 of file readTestVector.cc.

Referenced by main(), and parseTaus().

std::vector<int> l1taccepts

Definition at line 32 of file readTestVector.cc.

Referenced by main(), and parseAlgo().

std::vector<int> l1taccepts_evt

Definition at line 34 of file readTestVector.cc.

Referenced by main(), and parseAlgo().

std::vector<std::string> l1tnames

Definition at line 33 of file readTestVector.cc.

Referenced by main().

const int MAX_ALGO_BITS = 512

Definition at line 22 of file readTestVector.cc.

Referenced by main(), and parseAlgo().

double MaxCaloEta_ = 5.0
double MaxEt_ = 2047

Definition at line 90 of file readTestVector.cc.

Referenced by main(), parseEtSums(), and l1t::GenToInputProducer::produce().

double MaxJetPt_ = 1023

Definition at line 89 of file readTestVector.cc.

Referenced by main(), parseJets(), and l1t::GenToInputProducer::produce().

double MaxLepPt_ = 255
double MaxMuonEta_ = 2.45

Definition at line 93 of file readTestVector.cc.

Referenced by main(), parseMuons(), and l1t::GenToInputProducer::produce().

double PhiStepCalo_ = 144
double PhiStepMuon_ = 576

Definition at line 96 of file readTestVector.cc.

Referenced by main(), parseMuons(), and l1t::GenToInputProducer::produce().

double PtStep_ = 0.5
std::string zeroes128 = std::string(128,'0')

Definition at line 28 of file readTestVector.cc.

Referenced by parseAlgo().

std::string zeroes16 = std::string(16,'0')

Definition at line 29 of file readTestVector.cc.

Referenced by parseMuons().

std::string zeroes8 = std::string(8,'0')

Definition at line 30 of file readTestVector.cc.

Referenced by parseEGs(), parseEtSums(), parseJets(), and parseTaus().