ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/AnaTools/plugins/OSUAnalysis.cc
(Generate patch)

Comparing UserCode/OSUT3Analysis/AnaTools/plugins/OSUAnalysis.cc (file contents):
Revision 1.122 by jbrinson, Fri Aug 9 11:12:33 2013 UTC vs.
Revision 1.123 by wulsin, Mon Aug 12 21:03:10 2013 UTC

# Line 799 | Line 799 | OSUAnalysis::produce (edm::Event &event,
799  
800    if (find(objectsToGet.begin(), objectsToGet.end(), "triggers") != objectsToGet.end()) {
801      event.getByLabel (triggers_, triggers);
802 <    if (!triggers.product()) cout << "ERROR:  could not get triggers input collection" << endl;  
802 >    if (!triggers.product()) clog << "ERROR:  could not get triggers input collection" << endl;  
803    }
804  
805    if (find(objectsToGet.begin(), objectsToGet.end(), "trigobjs") != objectsToGet.end()) {
806      event.getByLabel (trigobjs_, trigobjs);
807 <    if (!trigobjs.product()) cout << "ERROR:  could not get trigobjs input collection" << endl;  
807 >    if (!trigobjs.product()) clog << "ERROR:  could not get trigobjs input collection" << endl;  
808    }
809  
810    if (find(objectsToGet.begin(), objectsToGet.end(), "jets") != objectsToGet.end()) {
811      event.getByLabel (jets_, jets);
812 <    if (!jets.product()) cout << "ERROR:  could not get jets input collection" << endl;  
812 >    if (!jets.product()) clog << "ERROR:  could not get jets input collection" << endl;  
813    }
814  
815    if (find(objectsToGet.begin(), objectsToGet.end(), "muons") != objectsToGet.end()) {
816      event.getByLabel (muons_, muons);
817 <    if (!muons.product()) cout << "ERROR:  could not get muons input collection" << endl;  
817 >    if (!muons.product()) clog << "ERROR:  could not get muons input collection" << endl;  
818    }
819  
820    if (find(objectsToGet.begin(), objectsToGet.end(), "secondary muons") != objectsToGet.end()) {
821      event.getByLabel (secMuons_, secMuons);
822 <    if (!secMuons.product()) cout << "ERROR:  could not get secMuons input collection" << endl;  
822 >    if (!secMuons.product()) clog << "ERROR:  could not get secMuons input collection" << endl;  
823    }
824  
825    if (find(objectsToGet.begin(), objectsToGet.end(), "electrons") != objectsToGet.end()) {
826      event.getByLabel (electrons_, electrons);
827 <    if (!electrons.product()) cout << "ERROR:  could not get electrons input collection" << endl;  
827 >    if (!electrons.product()) clog << "ERROR:  could not get electrons input collection" << endl;  
828    }
829  
830    if (find(objectsToGet.begin(), objectsToGet.end(), "events") != objectsToGet.end()) {
831      event.getByLabel (events_, events);
832 <    if (!events.product()) cout << "ERROR:  could not get events input collection" << endl;  
832 >    if (!events.product()) clog << "ERROR:  could not get events input collection" << endl;  
833    }
834  
835    if (find(objectsToGet.begin(), objectsToGet.end(), "taus") != objectsToGet.end()) {
836      event.getByLabel (taus_, taus);
837 <    if (!taus.product()) cout << "ERROR:  could not get taus input collection" << endl;  
837 >    if (!taus.product()) clog << "ERROR:  could not get taus input collection" << endl;  
838    }
839  
840    if (find(objectsToGet.begin(), objectsToGet.end(), "mets") != objectsToGet.end()) {
841      event.getByLabel (mets_, mets);
842 <    if (!mets.product()) cout << "ERROR:  could not get mets input collection" << endl;  
842 >    if (!mets.product()) clog << "ERROR:  could not get mets input collection" << endl;  
843    }
844  
845    if (find(objectsToGet.begin(), objectsToGet.end(), "tracks") != objectsToGet.end()) {
846      event.getByLabel (tracks_, tracks);
847 <    if (!tracks.product()) cout << "ERROR:  could not get tracks input collection" << endl;  
847 >    if (!tracks.product()) clog << "ERROR:  could not get tracks input collection" << endl;  
848    }
849  
850    if (find(objectsToGet.begin(), objectsToGet.end(), "genjets") != objectsToGet.end()) {
851      event.getByLabel (genjets_, genjets);
852 <    if (!genjets.product()) cout << "ERROR:  could not get genjets input collection" << endl;  
852 >    if (!genjets.product()) clog << "ERROR:  could not get genjets input collection" << endl;  
853    }
854  
855    if (find(objectsToGet.begin(), objectsToGet.end(), "mcparticles") != objectsToGet.end()) {
856      event.getByLabel (mcparticles_, mcparticles);
857 <    if (!mcparticles.product()) cout << "ERROR:  could not get mcparticles input collection" << endl;  
857 >    if (!mcparticles.product()) clog << "ERROR:  could not get mcparticles input collection" << endl;  
858    }
859  
860    if (find(objectsToGet.begin(), objectsToGet.end(), "primaryvertexs") != objectsToGet.end()) {
861      event.getByLabel (primaryvertexs_, primaryvertexs);
862 <    if (!primaryvertexs.product()) cout << "ERROR:  could not get primaryvertexs input collection" << endl;  
862 >    if (!primaryvertexs.product()) clog << "ERROR:  could not get primaryvertexs input collection" << endl;  
863    }
864  
865    if (find(objectsToGet.begin(), objectsToGet.end(), "bxlumis") != objectsToGet.end()) {
866      event.getByLabel (bxlumis_, bxlumis);
867 <    if (!bxlumis.product()) cout << "ERROR:  could not get bxlumis input collection" << endl;  
867 >    if (!bxlumis.product()) clog << "ERROR:  could not get bxlumis input collection" << endl;  
868    }
869  
870    if (find(objectsToGet.begin(), objectsToGet.end(), "photons") != objectsToGet.end()) {
871      event.getByLabel (photons_, photons);
872 <    if (!photons.product()) cout << "ERROR:  could not get photons input collection" << endl;  
872 >    if (!photons.product()) clog << "ERROR:  could not get photons input collection" << endl;  
873    }
874  
875    if (find(objectsToGet.begin(), objectsToGet.end(), "superclusters") != objectsToGet.end()) {
876      event.getByLabel (superclusters_, superclusters);
877 <    if (!superclusters.product()) cout << "ERROR:  could not get superclusters input collection" << endl;  
877 >    if (!superclusters.product()) clog << "ERROR:  could not get superclusters input collection" << endl;  
878    }
879  
880    if (datasetType_ == "signalMC"){
881      if (find(objectsToGet.begin(), objectsToGet.end(), "stops") != objectsToGet.end()) {
882        event.getByLabel (stops_, stops);
883 <      if (!stops.product()) cout << "ERROR:  could not get stops input collection" << endl;  
883 >      if (!stops.product()) clog << "ERROR:  could not get stops input collection" << endl;  
884      }
885    }
886  
# Line 890 | Line 890 | OSUAnalysis::produce (edm::Event &event,
890      // For description of rho values for different jet reconstruction algorithms, see
891      // https://twiki.cern.ch/twiki/bin/view/CMS/JetAlgorithms#Algorithms
892      event.getByLabel ("kt6CaloJets","rho", rhokt6CaloJetsHandle_);
893 <    if (!rhokt6CaloJetsHandle_.product()) cout << "ERROR:  could not get kt6CaloJets input collection" << endl;  
893 >    if (!rhokt6CaloJetsHandle_.product()) clog << "ERROR:  could not get kt6CaloJets input collection" << endl;  
894    }
895  
896    double masterScaleFactor = 1.0;
# Line 2980 | Line 2980 | OSUAnalysis::valueLookup (const BNtrack*
2980    else if(variable == "deltaRMinSubLeadJet") {
2981      // calculate minimum deltaR between track and any other subleading jet  
2982      double trkJetDeltaRMin = 99.;  
2983 +    if (!jets.product()) clog << "ERROR:  cannot find deltaRMinSubLeadJet because jets collection is not initialized." << endl;
2984      for (uint ijet = 0; ijet<jets->size(); ijet++) {
2985        string empty = "";  
2986        double isSubLeadingJet = valueLookup(&jets->at(ijet), "disappTrkSubLeadingJetID", "", empty);  
# Line 2995 | Line 2996 | OSUAnalysis::valueLookup (const BNtrack*
2996    else if(variable == "deltaRMinElecLooseMvaId") {
2997      // calculate minimum deltaR between track and any other electron passing loose mva ID, i.e., mvaNonTrigV0 > 0
2998      double trkElecDeltaRMin = 99.;  
2999 +    if (!electrons.product()) clog << "ERROR:  cannot find deltaRMinElecLooseMvaId because electrons collection is not initialized." << endl;
3000      for (uint ielec = 0; ielec<electrons->size(); ielec++) {
3001        string empty = "";  
3002        double mvaNonTrigV0 = valueLookup(&electrons->at(ielec), "mvaNonTrigV0", "", empty);  
# Line 3010 | Line 3012 | OSUAnalysis::valueLookup (const BNtrack*
3012    else if(variable == "deltaRMinMuonLooseId") {
3013      // calculate minimum deltaR between track and any other loose-Id muon
3014      double trkMuonDeltaRMin = 99.;  
3015 <    //    if (!muons) cout << "ERROR:  could not find muon collection for calculation of deltaRMinMuonLooseId" << endl;  
3015 >    if (!muons.product()) clog << "ERROR:  cannot find deltaRMinMuonLooseId because muons collection is not initialized." << endl;
3016      for (uint imuon = 0; imuon<muons->size(); imuon++) {
3017        string empty = "";  
3018        double isLooseIdMuon = valueLookup(&muons->at(imuon), "looseID", "", empty);  
# Line 3027 | Line 3029 | OSUAnalysis::valueLookup (const BNtrack*
3029  
3030      // calculate minimum deltaR between track and any other loose-Id
3031      double trkMuonDeltaRMin = 99.;
3032 <    //    if (!muons) cout << "ERROR:  could not find muon collection for calculation of deltaRMinMuonLooseId" <<                                                                          
3032 >    if (!muons.product()) clog << "ERROR:  cannot find deltaRMinMuonLooseId because muons collection is not initialized." << endl;
3033      for (uint imuon = 0; imuon<muons->size(); imuon++) {
3034        string empty = "";
3035        double isLooseIdMuon = valueLookup(&muons->at(imuon), "looseID", "", empty);
# Line 3046 | Line 3048 | OSUAnalysis::valueLookup (const BNtrack*
3048    else if(variable == "deltaRMinSecMuonLooseIdGlobal") {
3049      // calculate minimum deltaR between track and any other loose-Id muon
3050      double trkMuonDeltaRMin = 99.;  
3051 <    //    if (!secMuons) cout << "ERROR:  could not find secondary muon collection for calculation of deltaRMinSecMuonLooseIdGlobal" << endl;  
3051 >    if (!secMuons.product()) clog << "ERROR:  cannot find deltaRMinSecMuonLooseIdGlobal because secMuons collection is not initialized." << endl;
3052      for (uint imuon = 0; imuon<secMuons->size(); imuon++) {  
3053        string empty = "";  
3054        double isLooseIdMuon = valueLookup(&secMuons->at(imuon), "looseIDGlobalMuon", "", empty);  
# Line 3062 | Line 3064 | OSUAnalysis::valueLookup (const BNtrack*
3064    else if(variable == "deltaRMinTauLooseHadronicId") {
3065      // calculate minimum deltaR between track and any other tau passing loose hadronic ID  
3066      double trkTauDeltaRMin = 99.;  
3067 <    //    if (!taus) cout << "ERROR:  could not find tau collection for calculation of deltaRMinTauLooseHadronicId" << endl;  
3067 >    if (!taus.product()) clog << "ERROR:  cannot find deltaRMinTauLooseHadronicId because taus collection is not initialized." << endl;
3068      for (uint itau = 0; itau<taus->size(); itau++) {
3069        string empty = "";  
3070        double isIdTau = valueLookup(&taus->at(itau), "looseHadronicID", "", empty);  
# Line 4582 | Line 4584 | void OSUAnalysis::setObjectFlags(cut &cu
4584      }
4585    }
4586  
4587 <  if (!inputCollection) cout << "ERROR:  invalid input collection for inputType=" << inputType << endl;  
4587 >  if (!inputCollection) clog << "ERROR:  invalid input collection for inputType=" << inputType << endl;  
4588  
4589    if (verbose_>3) clog << "   Collection size:  " << inputCollection->size() << endl;
4590  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines