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);
77 std::auto_ptr<TauDiscriminator>
output(
new TauDiscriminator(
TauRefProd(taus)));
79 size_t nTaus = taus->size();
82 size_t nPrediscriminants = prediscriminants_.size();
83 for(
size_t iDisc = 0; iDisc < nPrediscriminants; ++iDisc )
85 prediscriminants_[iDisc].fill(event);
90 prediscriminants_[iDisc].handle->keyProduct().
id();
91 if (tauProductID != discKeyId) {
93 <<
"The tau collection with input tag " << TauProducer_
94 <<
" has product ID: " << tauProductID
95 <<
" but the pre-discriminator with input tag "
96 << prediscriminants_[iDisc].label
97 <<
" is keyed with product ID: " << discKeyId << std::endl;
102 for(
size_t iTau = 0; iTau < nTaus; ++iTau )
105 TauRef tauRef(taus, iTau);
107 bool passesPrediscriminants =
true;
109 for(
size_t iDisc = 0; iDisc < nPrediscriminants; ++iDisc )
112 double discResult = (*prediscriminants_[iDisc].handle)[tauRef];
113 uint8_t thisPasses = ( discResult > prediscriminants_[iDisc].cut ) ? 1 : 0;
130 if( thisPasses ^ andPrediscriminants_ )
132 passesPrediscriminants = ( andPrediscriminants_ ? 0 : 1 );
137 double result = prediscriminantFailValue_;
138 if( passesPrediscriminants )
141 result = discriminate(tauRef);
145 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 >()