#include <VisReco/Analyzer/interface/VisJet.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
VisJet (const edm::ParameterSet &) | |
virtual | ~VisJet () |
Private Attributes | |
double | energyCut_ |
edm::InputTag | inputTag_ |
Definition at line 18 of file VisJet.h.
VisJet::VisJet | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 29 of file VisJet.cc.
00030 : inputTag_ (iConfig.getParameter<edm::InputTag>("visJetTag")), 00031 energyCut_(iConfig.getUntrackedParameter<double>("energyCut", 0.1)) 00032 {}
void VisJet::analyze | ( | const edm::Event & | event, | |
const edm::EventSetup & | eventSetup | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 35 of file VisJet.cc.
References IgCollection::addProperty(), collection, edmplugin::standard::config(), IgCollection::create(), error, ET, ETA, Exception, funct::exp(), IgDataStorage::getCollection(), inputTag_, edm::InputTag::instance(), edm::Service< T >::isAvailable(), edm::Handle< T >::isValid(), it, pfTauBenchmarkGeneric_cfi::jets, edm::InputTag::label(), PHI, and edm::InputTag::process().
00036 { 00037 edm::Service<IguanaService> config; 00038 if (! config.isAvailable ()) 00039 { 00040 throw cms::Exception ("Configuration") 00041 << "VisJet requires the IguanaService\n" 00042 "which is not present in the configuration file.\n" 00043 "You must add the service in the configuration file\n" 00044 "or remove the module that requires it"; 00045 } 00046 00047 edm::Handle<reco::CaloJetCollection> collection; 00048 event.getByLabel (inputTag_, collection); 00049 00050 std::vector<edm::Handle<CaloTowerCollection> > towerCollections; 00051 event.getManyByType (towerCollections); 00052 00053 if (collection.isValid ()) 00054 { 00055 IgDataStorage *storage = config->storage (); 00056 IgCollection &jets = storage->getCollection ("Jets_V1"); 00057 00058 IgProperty ET = jets.addProperty ("et", 0.0); 00059 IgProperty ETA = jets.addProperty ("eta", 0.0); 00060 IgProperty THETA = jets.addProperty ("theta", 0.0); 00061 IgProperty PHI = jets.addProperty ("phi", 0.0); 00062 00063 for (reco::CaloJetCollection::const_iterator it = collection->begin (), itEnd = collection->end (); it != itEnd; ++it) 00064 { 00065 IgCollectionItem ijet = jets.create (); 00066 ijet[ET] = static_cast<double>((*it).et ()); 00067 ijet[ETA] = static_cast<double>((*it).eta ()); 00068 ijet[THETA] = static_cast<double>(2.0 * atan (exp (-(*it).eta ()))); 00069 ijet[PHI] = static_cast<double>((*it).phi()); 00070 } 00071 } 00072 else 00073 { 00074 // friendlyName:moduleLabel:instanceName:processName 00075 std::string error = "### Error: Jets " 00076 + edm::TypeID (typeid (reco::CaloJetCollection)).friendlyClassName () + ":" 00077 + inputTag_.label() + ":" 00078 + inputTag_.instance() + ":" 00079 + inputTag_.process() + " are not found."; 00080 00081 IgDataStorage *storage = config->storage (); 00082 IgCollection &collection = storage->getCollection ("Errors_V1"); 00083 IgProperty ERROR_MSG = collection.addProperty ("Error", std::string ()); 00084 IgCollectionItem item = collection.create (); 00085 item [ERROR_MSG] = error; 00086 } 00087 }
double VisJet::energyCut_ [private] |
edm::InputTag VisJet::inputTag_ [private] |