8 produces< vector<uint32_t> >();
9 produces< vector<uint32_t> >(
"assocHitsWithHCAL");
10 produces< std::vector<reco::Muon> >();
38 vector<uint32_t> hits ;
41 std::auto_ptr< vector<uint32_t> > selectedHitsAutoPtr(
new vector<uint32_t>(hits) );
42 iEvent.
put( selectedHitsAutoPtr );
44 vector<uint32_t> assoc_hits_withHCAL;
47 std::cout <<
"found in total " << assoc_hits_withHCAL.size() <<
" cells with associated hits with hcal\n";
48 std::auto_ptr< vector<uint32_t> > selectedAssocHitsWithHCALAutoPtr(
new vector<uint32_t>(assoc_hits_withHCAL) );
49 iEvent.
put( selectedAssocHitsWithHCALAutoPtr,
"assocHitsWithHCAL");
51 std::vector<reco::Muon>
muons;
53 muons.push_back(muon1);
54 muons.push_back(muon2);
55 std::auto_ptr< std::vector<reco::Muon> > selectedMuonsPtr(
new std::vector<reco::Muon>(
muons) );
56 iEvent.
put( selectedMuonsPtr );
78 if (!iEvent.
getByLabel(
"dimuonsGlobal", zCandidate_handle))
80 std::cout <<
"Could not find product: " <<
"dimuonsGlobal" <<
"\n";
81 std::vector< edm::Handle< edm::RefToBaseVector<reco::Candidate> > > allHandles;
83 std::vector< edm::Handle< edm::RefToBaseVector<reco::Candidate> > >::iterator it;
84 for (it = allHandles.begin(); it != allHandles.end(); it++)
86 std::cout <<
"available product: " << (*it).provenance()->moduleLabel() <<
", " << (*it).provenance()->productInstanceName() <<
", " << (*it).provenance()->processName();
89 std::cout <<
"Objekt nicht gefunden: dimuonsGloal\n";
94 unsigned int nMuons = zCandidate_handle->size();
107 bool found1=
false, found2=
false;
108 for (
unsigned int i=0;
i<muons.
size() && !(found1 && found2);
i++)
131 using namespace reco;
136 ProductNotFound<reco::MuonCollection>(iEvent,
muonInputTag_);
142 unsigned int nMuons =
muons.size();
157 using namespace reco;
166 L->push_back((*hit)->detid().rawId());
169 L->push_back((*hit)->detid().rawId());
172 for (
int i=0;
i<recs;
i++)
173 L->push_back(((muon->
bestTrackRef().
get())->recHit(
i).get())->geographicalId().rawId());
176 std::cout <<
"ERROR: Muon has no bestTrackRef!!\n";
178 std::cout <<
" with " << L->size() <<
" muon hits found\n";
185 std::cout <<
"--- TauHitSelector ------------------------------------\n";
186 std::cout <<
"Could not find product with:\n"<< inputTag <<
"\n";
187 std::vector< edm::Handle< T > > allHandles;
189 typename std::vector< edm::Handle< T > >::iterator it;
190 for (it = allHandles.begin(); it != allHandles.end(); it++)
192 std::cout <<
"module label: " << (*it).provenance()->moduleLabel() <<
"\n";
193 std::cout <<
"productInstanceName: " << (*it).provenance()->productInstanceName() <<
"\n";
194 std::cout <<
"processName: " << (*it).provenance()->processName() <<
"\n\n";
196 std::cout <<
"-------------------------------------------------------\n";
205 using namespace reco;
212 ROOT::Math::Boost booster(z_momentum.BoostToCM());
213 ROOT::Math::Boost invbooster(booster.Inverse());
222 double muonxb_mom2 = muon1b.x()*muon1b.x() + muon1b.y()*muon1b.y() + muon1b.z() * muon1b.z();
223 double tauxb_mom2 = 0.25 * Zb.t() * Zb.t() - tau_mass2;
225 float scaling1 =
sqrt(tauxb_mom2 / muonxb_mom2);
226 float scaling2 = scaling1;
228 float tauEnergy= Zb.t() / 2.;
230 if (tauEnergy*tauEnergy<tau_mass2)
241 assert((muon1b.phi()-tau1b_mom.phi())/muon1b.phi()<0.001);
242 assert((muon2b.phi()-tau2b_mom.phi())/muon2b.phi()<0.001);
243 assert((muon1b.theta()-tau1b_mom.theta())/muon1b.theta()<0.001);
244 assert((muon2b.theta()-tau2b_mom.theta())/muon2b.theta()<0.001);
255 assert(((muon1_momentum+muon1_momentum).
mass()-(tau1_mom+tau2_mom).
mass())/(muon1_momentum+muon1_momentum).
mass()<0.001);
256 assert(((muon1_momentum+muon2_momentum).pt()-(tau1_mom+tau2_mom).pt())/(muon1_momentum+muon1_momentum).pt()<0.001);
258 muon1->
setP4(tau1_mom);
259 muon2->
setP4(tau2_mom);
void getManyByType(std::vector< Handle< PROD > > &results) 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
virtual void setP4(const LorentzVector &p4)
set 4-momentum
SelectReplacementCandidates(const edm::ParameterSet &iSetup)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< const HBHERecHit * > hcalRecHits
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)
bool isNonnull() const
Checks for non-null.
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
value_type const * get() const
int determineMuonsToUse_old(const edm::Event &iEvent, const edm::EventSetup &iConfig, reco::Muon *muon1, reco::Muon *muon2)
virtual TrackBaseRef bestTrackRef() const
best track RefToBase
void loadParameters(const edm::ParameterSet &)