6 template<
class TauType,
class TauDiscriminator>
9 throw cms::Exception(
"TauDiscriminationProducerBase") <<
" -- default ctor called; derived classes must call " <<
10 "TauDiscriminationProducerBase(const ParameterSet&)";
14 template<
class TauType,
class TauDiscriminator>
25 std::string pdBoolOperator = prediscriminantConfig.
getParameter<std::string>(
"BooleanOperator");
27 transform(pdBoolOperator.begin(), pdBoolOperator.end(), pdBoolOperator.begin(), ::tolower);
29 if( pdBoolOperator ==
"and" )
31 andPrediscriminants_ = 0x1;
33 else if ( pdBoolOperator ==
"or" )
35 andPrediscriminants_ = 0x0;
39 throw cms::Exception(
"TauDiscriminationProducerBase") <<
"PrediscriminantBooleanOperator defined incorrectly, options are: AND,OR";
45 for( std::vector<std::string>::const_iterator iDisc = prediscriminantsNames.begin();
46 iDisc != prediscriminantsNames.end(); ++iDisc )
54 thisDiscriminator.cut =
cut;
55 prediscriminants_.push_back(thisDiscriminator);
58 prediscriminantFailValue_ = 0.;
61 produces<TauDiscriminator>();
64 template<
class TauType,
class TauDiscriminator>
68 beginEvent(event, eventSetup);
72 event.getByLabel(TauProducer_, taus);
75 std::auto_ptr<TauDiscriminator>
output(
new TauDiscriminator(
TauRefProd(taus)));
77 size_t nTaus = taus->size();
80 size_t nPrediscriminants = prediscriminants_.size();
81 for(
size_t iDisc = 0; iDisc < nPrediscriminants; ++iDisc )
83 prediscriminants_[iDisc].fill(event);
87 for(
size_t iTau = 0; iTau < nTaus; ++iTau )
92 bool passesPrediscriminants =
true;
94 for(
size_t iDisc = 0; iDisc < nPrediscriminants; ++iDisc )
97 double discResult = (*prediscriminants_[iDisc].handle)[tauRef];
98 uint8_t thisPasses = ( discResult > prediscriminants_[iDisc].cut ) ? 1 : 0;
116 if( thisPasses ^ andPrediscriminants_ )
118 passesPrediscriminants = ( andPrediscriminants_ ? 0 : 1 );
123 double result = prediscriminantFailValue_;
124 if( passesPrediscriminants )
127 result = discriminate(tauRef);
131 output->setValue(iTau, result);
T getParameter(std::string const &) const
std::string getProducerString< CaloTau >()
TauDiscriminationProducerBase()
void produce(edm::Event &, const edm::EventSetup &)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::string getProducerString< PFTau >()