13 const bool debug =
false;
22 produces<reco::BasicJetCollection>();
38 writeCompoundJets<reco::CaloJet>(
iEvent, iSetup );
41 writeCompoundJets<reco::PFJet>(
iEvent, iSetup );
44 writeCompoundJets<reco::GenJet>(
iEvent, iSetup );
47 writeCompoundJets<reco::BasicJet>(
iEvent, iSetup );
50 throw cms::Exception(
"InvalidInput") <<
"invalid jet type in CompoundJetProducer\n";
64 std::auto_ptr<std::vector<T> > subjetCollection(
new std::vector<T>() );
69 std::vector< std::vector<int> > indices;
71 std::vector<math::XYZTLorentzVector> p4_hardJets;
73 std::vector<double> area_hardJets;
77 std::vector<CompoundPseudoJet>::const_iterator it =
fjCompoundJets_.begin(),
81 for ( ; it != iEnd; ++it ) {
82 int jetIndex = it - iBegin;
83 fastjet::PseudoJet localJet = it->hardJet();
86 area_hardJets.push_back( it->hardJetArea() );
89 std::vector<CompoundPseudoSubJet>::const_iterator itSubJetBegin = it->subjets().begin(),
90 itSubJet = itSubJetBegin, itSubJetEnd = it->subjets().end();
91 for (; itSubJet != itSubJetEnd; ++itSubJet ){
93 fastjet::PseudoJet subjet = itSubJet->subjet();
98 std::vector<reco::CandidatePtr> subjetConstituents;
101 std::vector<int>
const & subjetFastjetConstituentIndices = itSubJet->constituents();
102 std::vector<int>::const_iterator fastSubIt = subjetFastjetConstituentIndices.begin(),
103 transConstBegin = subjetFastjetConstituentIndices.begin(),
104 transConstEnd = subjetFastjetConstituentIndices.end();
105 for ( ; fastSubIt != transConstEnd; ++fastSubIt ) {
107 if ( *fastSubIt < static_cast<int>(
inputs_.size()) )
108 subjetConstituents.push_back(
inputs_[*fastSubIt] );
112 indices[jetIndex].push_back( subjetCollection->size() );
118 jet.setJetArea( itSubJet->subjetArea() );
119 subjetCollection->push_back( jet );
128 std::vector<math::XYZTLorentzVector>::const_iterator ip4 = p4_hardJets.begin(),
129 ip4Begin = p4_hardJets.begin(),
130 ip4End = p4_hardJets.end();
132 for ( ; ip4 != ip4End; ++ip4 ) {
133 int p4_index = ip4 - ip4Begin;
134 std::vector<int> & ind = indices[p4_index];
135 std::vector<reco::CandidatePtr> i_hardJetConstituents;
137 for( std::vector<int>::const_iterator isub = ind.begin();
138 isub != ind.end(); ++isub ) {
140 i_hardJetConstituents.push_back( candPtr );
144 toput.
setJetArea( area_hardJets[ip4 - ip4Begin] );
145 jetCollection->push_back( toput );
149 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