8 produces< vector<uint32_t> >();
9 produces< vector<uint32_t> >(
"assocHitsWithHCAL");
10 produces< std::vector<reco::Muon> >();
39 vector<uint32_t> hits ;
42 std::auto_ptr< vector<uint32_t> > selectedHitsAutoPtr(
new vector<uint32_t>(hits) );
43 iEvent.
put( selectedHitsAutoPtr );
45 vector<uint32_t> assoc_hits_withHCAL;
48 std::cout <<
"found in total " << assoc_hits_withHCAL.size() <<
" cells with associated hits with hcal\n";
49 std::auto_ptr< vector<uint32_t> > selectedAssocHitsWithHCALAutoPtr(
new vector<uint32_t>(assoc_hits_withHCAL) );
50 iEvent.
put( selectedAssocHitsWithHCALAutoPtr,
"assocHitsWithHCAL");
52 std::vector<reco::Muon>
muons;
54 muons.push_back(muon1);
55 muons.push_back(muon2);
56 std::auto_ptr< std::vector<reco::Muon> > selectedMuonsPtr(
new std::vector<reco::Muon>(
muons) );
57 iEvent.
put( selectedMuonsPtr );
79 if (!iEvent.
getByLabel(
"dimuonsGlobal", zCandidate_handle))
81 std::cout <<
"Could not find product: " <<
"dimuonsGlobal" <<
"\n";
82 std::vector< edm::Handle< edm::RefToBaseVector<reco::Candidate> > > allHandles;
84 std::vector< edm::Handle< edm::RefToBaseVector<reco::Candidate> > >::iterator it;
85 for (it = allHandles.begin(); it != allHandles.end(); it++)
87 std::cout <<
"available product: " << (*it).provenance()->moduleLabel() <<
", " << (*it).provenance()->productInstanceName() <<
", " << (*it).provenance()->processName();
90 std::cout <<
"Objekt nicht gefunden: dimuonsGloal\n";
95 unsigned int nMuons = zCandidate_handle->size();
108 bool found1=
false, found2=
false;
109 for (
unsigned int i=0;
i<muons.
size() && !(found1 && found2);
i++)
132 using namespace reco;
137 ProductNotFound<reco::MuonCollection>(iEvent,
muonInputTag_);
143 unsigned int nMuons =
muons.size();
158 using namespace reco;
167 L->push_back((*hit)->detid().rawId());
170 L->push_back((*hit)->detid().rawId());
173 for (
int i=0;
i<recs;
i++)
174 L->push_back(((muon->
bestTrackRef().
get())->recHit(
i).get())->geographicalId().rawId());
177 std::cout <<
"ERROR: Muon has no bestTrackRef!!\n";
179 std::cout <<
" with " << L->size() <<
" muon hits found\n";
186 std::cout <<
"--- TauHitSelector ------------------------------------\n";
187 std::cout <<
"Could not find product with:\n"<< inputTag <<
"\n";
188 std::vector< edm::Handle< T > > allHandles;
190 typename std::vector< edm::Handle< T > >::iterator it;
191 for (it = allHandles.begin(); it != allHandles.end(); it++)
193 std::cout <<
"module label: " << (*it).provenance()->moduleLabel() <<
"\n";
194 std::cout <<
"productInstanceName: " << (*it).provenance()->productInstanceName() <<
"\n";
195 std::cout <<
"processName: " << (*it).provenance()->processName() <<
"\n\n";
197 std::cout <<
"-------------------------------------------------------\n";
206 using namespace reco;
213 ROOT::Math::Boost booster(z_momentum.BoostToCM());
214 ROOT::Math::Boost invbooster(booster.Inverse());
223 double muonxb_mom2 = muon1b.x()*muon1b.x() + muon1b.y()*muon1b.y() + muon1b.z() * muon1b.z();
224 double tauxb_mom2 = 0.25 * Zb.t() * Zb.t() - tau_mass2;
226 float scaling1 =
sqrt(tauxb_mom2 / muonxb_mom2);
227 float scaling2 = scaling1;
229 float tauEnergy= Zb.t() / 2.;
231 if (tauEnergy*tauEnergy<tau_mass2)
242 assert((muon1b.phi()-tau1b_mom.phi())/muon1b.phi()<0.001);
243 assert((muon2b.phi()-tau2b_mom.phi())/muon2b.phi()<0.001);
244 assert((muon1b.theta()-tau1b_mom.theta())/muon1b.theta()<0.001);
245 assert((muon2b.theta()-tau2b_mom.theta())/muon2b.theta()<0.001);
256 assert(((muon1_momentum+muon1_momentum).mass()-(tau1_mom+tau2_mom).mass())/(muon1_momentum+muon1_momentum).mass()<0.001);
257 assert(((muon1_momentum+muon2_momentum).
pt()-(tau1_mom+tau2_mom).
pt())/(muon1_momentum+muon1_momentum).
pt()<0.001);
259 muon1->
setP4(tau1_mom);
260 muon2->
setP4(tau2_mom);
void getManyByType(std::vector< Handle< PROD > > &results) const
value_type const * get() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual int pdgId() const
PDG identifier.
TrackDetectorAssociator trackAssociator_
double targetParticleMass_
edm::InputTag muonInputTag_
virtual void setStatus(int status)
set status word
void ProductNotFound(const edm::Event &iEvent, edm::InputTag inputTag)
#define DEFINE_FWK_MODULE(type)
std::vector< const EcalRecHit * > ecalRecHits
hits in the cone
void useDefaultPropagator()
use the default propagator
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
virtual void setP4(const LorentzVector &p4)
set 4-momentum
bool isNonnull() const
Checks for non-null.
SelectReplacementCandidates(const edm::ParameterSet &iSetup)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< const HBHERecHit * > hcalRecHits
Abs< T >::type abs(const T &t)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double deltaR(double eta1, double eta2, double phi1, double phi2)
int determineMuonsToUse(const edm::Event &iEvent, const edm::EventSetup &iConfig, reco::Muon *muon1, reco::Muon *muon2)
~SelectReplacementCandidates()
void getRawIDsAdvanced(const edm::Event &iEvent, const edm::EventSetup &iConfig, std::vector< uint32_t > *L, reco::Muon *muon, bool includeHCAL)
void transformMuMu2TauTau(reco::Muon *muon1, reco::Muon *muon2)
transform muon into tau
virtual void setPdgId(int pdgId)
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
TrackAssociatorParameters parameters_
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iConfig)
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
int determineMuonsToUse_old(const edm::Event &iEvent, const edm::EventSetup &iConfig, reco::Muon *muon1, reco::Muon *muon2)
virtual TrackBaseRef bestTrackRef() const
best track RefToBase