202 LogDebug(
"GtGenToInputProducer") <<
"GenToInputProducer::produce function called...\n";
205 std::vector<l1t::Muon> muonVec;
206 std::vector<l1t::MuonShower> muonShowerVec;
207 std::vector<l1t::EGamma> egammaVec;
208 std::vector<l1t::Tau> tauVec;
209 std::vector<l1t::Jet> jetVec;
210 std::vector<l1t::EtSum> etsumVec;
218 double MaxLepPt_ = 255;
219 double MaxJetPt_ = 1023;
220 double MaxEt_ = 2047;
222 double MaxCaloEta_ = 5.0;
223 double MaxMuonEta_ = 2.45;
225 double PhiStepCalo_ = 144;
226 double PhiStepMuon_ = 576;
229 double EtaStepCalo_ = 230;
230 double EtaStepMuon_ = 450;
233 double PtStep_ = 0.5;
244 std::vector<int> mu_cands_index;
245 std::vector<int> eg_cands_index;
246 std::vector<int> tau_cands_index;
255 double pt = mcParticle.
pt();
264 eg_cands_index.push_back(
k);
266 mu_cands_index.push_back(
k);
268 tau_cands_index.push_back(
k);
271 LogTrace(
"GtGenToInputProducer") <<
">>> GenParticles collection not found!" << std::endl;
284 cout <<
"GenToInputProducer MuonShower = (MUS0, MUS1, MUS2, MUSOOT0, MUSOOT1) = (" << mus0 <<
"," << mus1 <<
"," 285 << mus2 <<
"," << musoot0 <<
"," << musoot1 <<
")" << endl;
286 l1t::MuonShower muShower(mus0, musoot0, mus2Loose, musoot2Loose, mus1, musoot1, mus2);
287 muShower.setMusOutOfTime0(musoot0);
288 muShower.setMusOutOfTime1(musoot1);
289 muonShowerVec.push_back(muShower);
292 int numMuCands =
int(mu_cands_index.size());
293 Int_t idxMu[numMuCands];
294 double muPtSorted[numMuCands];
295 for (
int iMu = 0; iMu < numMuCands; iMu++)
296 muPtSorted[iMu] =
genParticles->at(mu_cands_index[iMu]).pt();
298 TMath::Sort(numMuCands, muPtSorted, idxMu);
299 for (
int iMu = 0; iMu < numMuCands; iMu++) {
303 const reco::Candidate& mcParticle = (*genParticles)[mu_cands_index[idxMu[iMu]]];
308 int qual =
gRandom->Integer(16);
332 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* p4 =
333 new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
357 muonVec.push_back(
mu);
361 int numEgCands =
int(eg_cands_index.size());
362 Int_t idxEg[numEgCands];
363 double egPtSorted[numEgCands];
364 for (
int iEg = 0; iEg < numEgCands; iEg++)
365 egPtSorted[iEg] =
genParticles->at(eg_cands_index[iEg]).pt();
367 TMath::Sort(numEgCands, egPtSorted, idxEg);
368 for (
int iEg = 0; iEg < numEgCands; iEg++) {
372 const reco::Candidate& mcParticle = (*genParticles)[eg_cands_index[idxEg[iEg]]];
377 int qual =
gRandom->Integer(2);
384 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* p4 =
385 new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
388 egammaVec.push_back(eg);
392 int numTauCands =
int(tau_cands_index.size());
393 Int_t idxTau[numTauCands];
394 double tauPtSorted[numTauCands];
395 for (
int iTau = 0; iTau < numTauCands; iTau++)
396 tauPtSorted[iTau] =
genParticles->at(tau_cands_index[iTau]).pt();
398 TMath::Sort(numTauCands, tauPtSorted, idxTau);
399 for (
int iTau = 0; iTau < numTauCands; iTau++) {
403 const reco::Candidate& mcParticle = (*genParticles)[tau_cands_index[idxTau[iTau]]];
408 int qual =
gRandom->Integer(2);
415 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* p4 =
416 new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
419 tauVec.push_back(
tau);
424 int maxOtherTaus = 8;
425 int numCurrentEGs =
int(egammaVec.size());
426 int numCurrentTaus =
int(tauVec.size());
428 int numExtraEGs = 0, numExtraTaus = 0;
439 for (reco::GenJetCollection::const_iterator genJet =
genJets->begin(); genJet !=
genJets->end(); ++genJet) {
441 sumEt += genJet->et();
450 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* p4 =
451 new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
454 int eta =
convertEtaToHW(genJet->eta(), -MaxCaloEta_, MaxCaloEta_, EtaStepCalo_);
461 int qual =
gRandom->Integer(2);
464 jetVec.push_back(
jet);
469 if ((numExtraEGs + numCurrentEGs) <
maxNumEGCands_ && numExtraEGs < maxOtherEGs) {
473 int EGeta =
convertEtaToHW(genJet->eta(), -MaxCaloEta_, MaxCaloEta_, EtaStepCalo_);
476 int EGqual =
gRandom->Integer(2);
477 int EGiso =
gRandom->Integer(4) % 2;
479 l1t::EGamma eg(*p4, EGpt, EGeta, EGphi, EGqual, EGiso);
480 egammaVec.push_back(eg);
483 if ((numExtraTaus + numCurrentTaus) <
maxNumTauCands_ && numExtraTaus < maxOtherTaus) {
487 int Taueta =
convertEtaToHW(genJet->eta(), -MaxCaloEta_, MaxCaloEta_, EtaStepCalo_);
489 int Tauqual =
gRandom->Integer(2);
490 int Tauiso =
gRandom->Integer(4) % 2;
492 l1t::Tau tau(*p4, Taupt, Taueta, Tauphi, Tauqual, Tauiso);
493 tauVec.push_back(
tau);
498 LogTrace(
"GtGenToInputProducer") <<
">>> GenJets collection not found!" << std::endl;
503 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* p4 =
504 new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
516 int nAsymEt = 255 *
gRandom->Rndm();
518 int nAsymHt = 255 *
gRandom->Rndm();
520 int nAsymEtHF = 255 *
gRandom->Rndm();
522 int nAsymHtHF = 255 *
gRandom->Rndm();
529 int hfP0val =
gRandom->Poisson(4.);
534 int hfM0val =
gRandom->Poisson(4.);
539 int hfP1val =
gRandom->Poisson(4.);
544 int hfM1val =
gRandom->Poisson(4.);
550 int cent30val(0), cent74val(0);
551 int centa =
gRandom->Poisson(2.);
552 int centb =
gRandom->Poisson(2.);
553 if (centa >= centb) {
568 centralval |= cent30val & 0xF;
569 centralval |= (cent74val & 0xF) <<
shift;
600 LogTrace(
"GtGenToInputProducer") <<
">>> GenMet collection not found!" << std::endl;
610 etsumVec.push_back(etTotal);
611 etsumVec.push_back(etEmTotal);
612 etsumVec.push_back(hfP0);
614 etsumVec.push_back(htTotal);
615 etsumVec.push_back(towerCounts);
616 etsumVec.push_back(hfM0);
618 etsumVec.push_back(
etmiss);
619 etsumVec.push_back(AsymEt);
620 etsumVec.push_back(hfP1);
622 etsumVec.push_back(
htmiss);
623 etsumVec.push_back(AsymHt);
624 etsumVec.push_back(hfM1);
626 etsumVec.push_back(etmissHF);
627 etsumVec.push_back(AsymEtHF);
629 etsumVec.push_back(htmissHF);
630 etsumVec.push_back(AsymHtHF);
631 etsumVec.push_back(centrality);
634 if ((
iEvent.id().event()) % 2 == 0) {
635 for (
int i = 0;
i < 255;
i =
i + 2)
638 for (
int i = 1;
i < 255;
i =
i + 2)
659 for (
int iMu = 0; iMu <
int(muonVec.size()); iMu++) {
660 muons->push_back(2, muonVec[iMu]);
681 for (
int iMuShower = 0; iMuShower <
int(muonShowerVec.size()); iMuShower++) {
682 muonShowers->push_back(2, muonShowerVec[iMuShower]);
686 muonShowerVec.clear();
703 for (
int iEG = 0; iEG <
int(egammaVec.size()); iEG++) {
704 egammas->push_back(2, egammaVec[iEG]);
725 for (
int iTau = 0; iTau <
int(tauVec.size()); iTau++) {
726 taus->push_back(2, tauVec[iTau]);
747 for (
int iJet = 0; iJet <
int(jetVec.size()); iJet++) {
748 jets->push_back(2, jetVec[iJet]);
769 for (
int iETsum = 0; iETsum <
int(etsumVec.size()); iETsum++) {
770 etsums->push_back(2, etsumVec[iETsum]);
783 extCond->push_back(2, extCond_bx);
BXVector< GlobalExtBlk > GlobalExtBlkBxCollection
void reset()
reset the content of a GlobalExtBlk
static constexpr int nTowers
virtual double pt() const =0
transverse momentum
virtual int status() const =0
status word
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Abs< T >::type abs(const T &t)
virtual int charge() const =0
electric charge
void setExternalDecision(unsigned int bit, bool val)
Set decision bits.
virtual int pdgId() const =0
PDG identifier.
TLorentzVector genMet(const HepMC::GenEvent *all, double etamin=-9999., double etamax=9999.)
static unsigned int const shift
isoSum
===> compute the isolation and find the most isolated track
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity