ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/CmsHi/JetAnalysis/src/BaseHiGenJetProducer.cc
(Generate patch)

Comparing UserCode/CmsHi/JetAnalysis/src/BaseHiGenJetProducer.cc (file contents):
Revision 1.1 by yilmaz, Mon Apr 27 21:24:37 2009 UTC vs.
Revision 1.2 by yilmaz, Wed May 6 19:09:22 2009 UTC

# Line 73 | Line 73 | namespace {
73    template <class T>  
74    void dumpJets (const T& fJets) {
75      for (unsigned i = 0; i < fJets.size(); ++i) {
76 <      std::cout << "Jet # " << i << std::endl << fJets[i].print();
76 >      std::cout<< "Jet # " << i << std::endl << fJets[i].print();
77      }
78    }
79  
# Line 101 | Line 101 | namespace cms
101        mVerbose (conf.getUntrackedParameter<bool>("verbose", false)),
102        mEtInputCut (conf.getParameter<double>("inputEtMin")),
103        mEInputCut (conf.getParameter<double>("inputEMin")),
104 <      skipLastSubEvent_ (conf.getUntrackedParameter<bool>("skipLastSubEvent", true))
104 >      skipLastSubEvent_ (conf.getUntrackedParameter<bool>("skipLastSubEvent", true)),
105 >      nHydro_(conf.getUntrackedParameter<double>("maxParticles", 2000))
106    {
107      std::string alias = conf.getUntrackedParameter<string>( "alias", conf.getParameter<std::string>("@module_label"));
108      if (makeCaloJet (mJetType)) {
# Line 135 | Line 136 | namespace cms
136       vector <ProtoJet> output;
137       vector<JetReco::InputCollection> inputs;
138  
139 +     int hydroEvent = -1;
140 +     vector<int> nsubparticle;
141 +
142       for (unsigned i = 0; i < inputHandle->size(); ++i) {
143  
144          const GenParticle & p = (*inputHandle)[i];
145          if(!selectForJet(p)) continue;
146          int subevent = (*subs)[GenParticleRef(inputHandle,i)];
147 <        cout<<"inputs size "<<inputs.size()<<" subevent "<<subevent<<endl;
144 <
145 <        if(subevent >= inputs.size()) inputs.resize(subevent+1);
147 >        LogDebug("SubEventJets")<<"inputs size "<<inputs.size()<<" subevent "<<subevent;
148  
149 +        if(subevent >= inputs.size()){
150 +           inputs.resize(subevent+1);
151 +           nsubparticle.resize(subevent+1);
152 +        }
153          //      cout<<"inputs size "<<inputs.size()<<" subevent "<<subevent<<endl;
154 <
155 <        (inputs[subevent]).push_back(JetReco::InputItem(&p,i));
154 >        if(nsubparticle[subevent]< nHydro_){
155 >           (inputs[subevent]).push_back(JetReco::InputItem(&p,i));      
156 >           nsubparticle[subevent]++;
157 >        }else{
158 >           LogDebug("JetsInHydro")<<"More particles than hydro cut, Sub-Event :  "<<subevent;
159 >           if(subevent != hydroEvent && hydroEvent != -1){
160 >              edm::LogError("JetsInHydro")<<"More than one hydro event identified, Sub-Event :  "<<subevent;
161 >           }
162 >           hydroEvent = subevent;
163 >        }
164       }
165  
166       int nsub = inputs.size();
167       for(int isub = 0; isub < nsub; ++isub){
168          cout<<"Processing Sub-Event : "<<isub<<endl;
169          JetReco::InputCollection & input = inputs[isub];
170 <        if(skipLastSubEvent_ && isub == nsub-1){
171 <           cout<<"Sub-Event number "<<isub<<" with "<<input.size()<<" particles, skipped as background event."<<endl;
170 >        //      if(skipLastSubEvent_ && isub == nsub-1){
171 >        if(isub == hydroEvent){
172 >           cout<<"Sub-Event number "<<isub<<" with more than "<<input.size()<<" particles, skipped as background event."<<endl;
173          }else{
174  
175             if (mVerbose) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines