16 produces<reco::BasicJetCollection>();
32 writeCompoundJets<reco::CaloJet>(
iEvent, iSetup );
35 writeCompoundJets<reco::PFJet>(
iEvent, iSetup );
38 writeCompoundJets<reco::GenJet>(
iEvent, iSetup );
41 writeCompoundJets<reco::BasicJet>(
iEvent, iSetup );
44 throw cms::Exception(
"InvalidInput") <<
"invalid jet type in CompoundJetProducer\n";
58 std::auto_ptr<std::vector<T> > subjetCollection(
new std::vector<T>() );
63 std::vector< std::vector<int> > indices;
65 std::vector<math::XYZTLorentzVector> p4_hardJets;
67 std::vector<double> area_hardJets;
71 std::vector<CompoundPseudoJet>::const_iterator it =
fjCompoundJets_.begin(),
75 for ( ; it != iEnd; ++it ) {
76 int jetIndex = it - iBegin;
77 fastjet::PseudoJet localJet = it->hardJet();
80 area_hardJets.push_back( it->hardJetArea() );
83 std::vector<CompoundPseudoSubJet>::const_iterator itSubJetBegin = it->subjets().begin(),
84 itSubJet = itSubJetBegin, itSubJetEnd = it->subjets().end();
85 for (; itSubJet != itSubJetEnd; ++itSubJet ){
87 fastjet::PseudoJet subjet = itSubJet->subjet();
92 std::vector<reco::CandidatePtr> subjetConstituents;
95 std::vector<int>
const & subjetFastjetConstituentIndices = itSubJet->constituents();
96 std::vector<int>::const_iterator fastSubIt = subjetFastjetConstituentIndices.begin(),
97 transConstEnd = subjetFastjetConstituentIndices.end();
98 for ( ; fastSubIt != transConstEnd; ++fastSubIt ) {
100 if ( *fastSubIt < static_cast<int>(
inputs_.size()) )
101 subjetConstituents.push_back(
inputs_[*fastSubIt] );
105 indices[jetIndex].push_back( subjetCollection->size() );
111 jet.setJetArea( itSubJet->subjetArea() );
112 subjetCollection->push_back( jet );
121 std::vector<math::XYZTLorentzVector>::const_iterator ip4 = p4_hardJets.begin(),
122 ip4Begin = p4_hardJets.begin(),
123 ip4End = p4_hardJets.end();
125 for ( ; ip4 != ip4End; ++ip4 ) {
126 int p4_index = ip4 - ip4Begin;
127 std::vector<int> & ind = indices[p4_index];
128 std::vector<reco::CandidatePtr> i_hardJetConstituents;
130 for( std::vector<int>::const_iterator isub = ind.begin();
131 isub != ind.end(); ++isub ) {
133 i_hardJetConstituents.push_back( candPtr );
137 toput.
setJetArea( area_hardJets[ip4 - ip4Begin] );
138 jetCollection->push_back( toput );
142 iEvent.
put( jetCollection);
void writeCompoundJets(edm::Event &iEvent, edm::EventSetup const &iSetup)
function template to write out the outputs
virtual void inputTowers()
virtual void inputTowers()
compound fastjet::PseudoJets
Jets made from CaloTowers.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual void setJetArea(float fArea)
set jet area
std::string jetCollInstanceName_
std::vector< edm::Ptr< reco::Candidate > > inputs_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
math::XYZPoint Point
point in the space
std::vector< CompoundPseudoJet > fjCompoundJets_
virtual void output(edm::Event &iEvent, edm::EventSetup const &iSetup)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
void writeSpecific(reco::CaloJet &jet, reco::Particle::LorentzVector const &p4, reco::Particle::Point const &point, std::vector< reco::CandidatePtr > const &constituents, edm::EventSetup const &c)
std::vector< BasicJet > BasicJetCollection
collection of BasicJet objects