190 LogInfo(
"ZToMuMuGammaAnalyzer") <<
"ZToMuMuGammaAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " <<
nEvt_ <<
"\n";
194 bool validTriggerEvent=
true;
198 if(!triggerEventHandle.isValid()) {
200 validTriggerEvent=
false;
202 if(validTriggerEvent) triggerEvent = *(triggerEventHandle.product());
206 bool validPhotons=
true;
210 if ( !photonHandle.isValid()) {
214 if(validPhotons) photonCollection = *(photonHandle.product());
217 bool validloosePhotonID=
true;
220 e.
getByLabel(
"PhotonIDProd",
"PhotonCutBasedIDLoose", loosePhotonFlag);
221 if ( !loosePhotonFlag.isValid()) {
222 edm::LogInfo(
"ZToMuMuGammaAnalyzer") <<
"Error! Can't get the product "<<
"PhotonCutBasedIDLoose" << endl;
223 validloosePhotonID=
false;
225 if (validloosePhotonID) loosePhotonID = *(loosePhotonFlag.product());
227 bool validtightPhotonID=
true;
230 e.
getByLabel(
"PhotonIDProd",
"PhotonCutBasedIDTight", tightPhotonFlag);
231 if ( !tightPhotonFlag.isValid()) {
232 edm::LogInfo(
"ZToMuMuGammaAnalyzer") <<
"Error! Can't get the product "<<
"PhotonCutBasedIDTight" << endl;
233 validtightPhotonID=
false;
235 if (validtightPhotonID) tightPhotonID = *(tightPhotonFlag.product());
238 bool validMuons=
true;
242 if ( !muonHandle.isValid()) {
246 if(validMuons) muonCollection = *(muonHandle.product());
251 if (!bsHandle.isValid()) {
252 edm::LogError(
"TrackerOnlyConversionProducer") <<
"Error! Can't get the product primary Vertex Collection "<<
"\n";
262 for(uint filterIndex=0;filterIndex<triggerEvent.sizeFilters();++filterIndex){
263 string label = triggerEvent.filterTag(filterIndex).label();
264 if(label.find(
"Photon" ) != string::npos ) {
265 for(uint filterKeyIndex=0;filterKeyIndex<triggerEvent.filterKeys(filterIndex).size();++filterKeyIndex){
266 Keys.push_back(triggerEvent.filterKeys(filterIndex)[filterKeyIndex]);
274 for ( uint
i=0 ;
i<
Keys.size() ; )
276 if (
i!=(
Keys.size()-1))
287 if ( muonCollection.size() < 2 )
return;
289 for( reco::MuonCollection::const_iterator iMu = muonCollection.begin(); iMu != muonCollection.end(); iMu++) {
292 for( reco::MuonCollection::const_iterator iMu2 = iMu+1; iMu2 != muonCollection.end(); iMu2++) {
294 if ( iMu->charge()*iMu2->charge() > 0)
continue;
301 if ( mumuMass < minMumuInvMass_ || mumuMass >
maxMumuInvMass_ )
continue;
305 if ( photonCollection.size() < 1 )
continue;
309 for( reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {
314 double dr1 =
deltaR(*iMu, *iPho);
315 double dr2 =
deltaR(*iMu2,*iPho);
318 nearMuon =*iMu ; farMuon = *iMu2; drNear = dr1;
320 nearMuon = *iMu2; farMuon = *iMu; drNear = dr2;
float sumPt
sum-pt of tracks
bool muonSelection(const reco::Muon &m, const reco::BeamSpot &bs)
The single EDProduct to be saved for each event (AOD case)
MonitorElement * h1_mumuGammaInvMass_
unsigned int prescaleFactor_
std::string photonProducer_
std::vector< Muon > MuonCollection
collection of Muon objects
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * h1_mumuInvMass_
float mumuInvMass(const reco::Muon &m1, const reco::Muon &m2)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double deltaR(double eta1, double eta2, double phi1, double phi2)
bool photonSelection(const reco::Photon &p)
virtual double pt() const
transverse momentum
std::vector< size_type > Keys
std::string muonCollection_
std::vector< Photon > PhotonCollection
collectin of Photon objects
bool basicMuonSelection(const reco::Muon &m)
std::string muonProducer_
std::string photonCollection_
edm::InputTag triggerEvent_
float maxMumuGammaInvMass_
float mumuGammaInvMass(const reco::Muon &mu1, const reco::Muon &mu2, const reco::Photon &pho)
const MuonIsolation & isolationR03() const