CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWLiteJetProducer.cc
Go to the documentation of this file.
14 #include <iostream>
15 #include <vector>
16 
17 using namespace reco;
18 using namespace std;
19 using namespace JetReco;
20 
21 //--------------test Mac/afs------------------
22 
24 
25  mEtInputCut_=0.5;
26  mEInputCut_=0.;
27  seedThreshold_=1.0;
28  coneRadius_=0.5;
29  coneAreaFraction_=1.0;
30  maxPairSize_=2;
31  maxIterations_=100;
32  overlapThreshold_=0.75;
33  ptMin_=10.;
34  rparam_=1.;
35  algoIC_=0;
36  algoMC_=0;
37 }
38 
39 
40 
41 
42 //-----------------------------------------------------------
44  delete algoIC_;
45  delete algoMC_;
46 }
47 //-----------------------------------------------------------
48 
50 
51  if (algoIC_) delete algoIC_;
52  if (algoMC_) delete algoMC_;
53  algoIC_= new CMSIterativeConeAlgorithm(seedThreshold_,coneRadius_ );
54  algoMC_= new CMSMidpointAlgorithm(seedThreshold_, coneRadius_,coneAreaFraction_,
55  maxPairSize_, maxIterations_, overlapThreshold_, 0) ;
56  algoF_.setPtMin(ptMin_);
57  algoF_.setRParam(rparam_);
58  print();
59 }
60 
61 
62 //-----------------------------------------------------------
64 
65  cout <<"--- FWLiteJetProducer:Print(): ---" << endl;
66 
67  cout <<"Cut: mEtInputCut " << mEtInputCut_ <<endl;
68  cout <<"Cut: mEInputCut " << mEInputCut_<<endl;
69  cout <<"IC/MC: seedThreshold " << seedThreshold_ <<endl;
70  cout <<"IC/MC: coneRadius " << coneRadius_ <<endl;
71  cout <<"MC: coneAreaFraction " << coneAreaFraction_ <<endl;
72  cout <<"MC: maxPairSize " <<maxPairSize_ <<endl;
73  cout <<"MC: maxIterations " << maxIterations_ <<endl;
74  cout <<"MC: overlapThreshold " << overlapThreshold_<<endl;
75  cout <<"FJ: PtMin " << ptMin_ <<endl;
76  cout <<"FJ: Rparam " << rparam_<<endl;
77  cout <<"----------------------------------" << endl;
78 
79 }
80 
81 
82 
83 //-----------------------------------------------------------
87  //edm::OrphanHandle< reco::CandidateCollection > CandidateHandle(&(Candidates), edm::ProductID(20001) );
88 
89  input->reserve ( Candidates.size());
90  //cout<<" Candidate " << CandidateHandle->size()<<Candidates.size() << endl;
91  for (unsigned i = 0; i <Candidates.size() ; i++) {
92  const reco::Candidate* constituent = Candidates[i].get();
93 
94  if ((mEtInputCut_ <= 0 || constituent->et() > mEtInputCut_) &&
95  (mEInputCut_ <= 0 || constituent->energy() > mEInputCut_)) {
96  input->push_back (InputItem(constituent,i));
97  }
98  }
99 }
100 
101 //-----------------------------------------------------------
103  if (fInput.empty ()) {
104  std::cout << "empty input for jet algorithm: bypassing..." << std::endl;
105  }
106  else {
107  algoIC_->run(fInput, & (*fOutput));
108  }
109 }
110 
111 //-----------------------------------------------------------
113  // FastJetFWLiteWrapper algo;
114  if (fInput.empty ()) {
115  std::cout << "empty input for jet algorithm: bypassing..." << std::endl;
116  }
117  else {
118  algoF_.run(fInput, &(*fOutput));
119  }
120 }
121 
122 //-----------------------------------------------------------
124  // CMSMidpointAlgorithm algo;
125  if (fInput.empty ()) {
126  std::cout << "empty input for jet algorithm: bypassing..." << std::endl;
127  }
128  else {
129  algoMC_->run(fInput, &(*fOutput));
130  }
131 }
132 
133 
134 
135 //-----------------------------------------------------------
int i
Definition: DBlmapReader.cc:9
std::vector< ProtoJet > OutputCollection
Definition: JetRecoTypes.h:63
size_type size() const
Size of the RefVector.
Definition: PtrVectorBase.h:72
void makeIterativeConeJets(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
Produce jet collection using CMS Iterative Cone Algorithm.
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:135
std::vector< InputItem > InputCollection
Definition: JetRecoTypes.h:62
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:8
void applyCuts(const reco::CandidatePtrVector &Candidates, JetReco::InputCollection *input)
~FWLiteJetProducer()
destructor
void makeMidpointJets(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
Produce jet collection using CMS Midpoint Jet Algorithm.
tuple input
Definition: collect_tpl.py:10
void makeFastJets(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
Produce jet collection using CMS Fast Jet Algorithm.
tuple cout
Definition: gather_cfg.py:41
CorrectedIndexedCandidate InputItem
Definition: JetRecoTypes.h:60
FWLiteJetProducer()
default constructor