CMS 3D CMS Logo

IsoDepositVetoFactory Class Reference

#include <PhysicsTools/IsolationAlgos/interface/IsoDepositVetoFactory.h>

List of all members.

Static Public Member Functions

static reco::isodeposit::AbsVetomake (const char *string, reco::isodeposit::EventDependentAbsVeto *&evdep)
 As above, but will allow also AbsVetos which depend from the edm::Event If the resulting veto is dependent on the edm::Event, the value of the second pointer will be set to non-zero Note that both pointers will point to the same object, so you have to delete it only once.
static reco::isodeposit::AbsVetomake (const char *string)
 Returns a pointer to an AbsVeto defined by the string.


Detailed Description

Definition at line 7 of file IsoDepositVetoFactory.h.


Member Function Documentation

reco::isodeposit::AbsVeto * IsoDepositVetoFactory::make ( const char *  string,
reco::isodeposit::EventDependentAbsVeto *&  evdep 
) [static]

As above, but will allow also AbsVetos which depend from the edm::Event If the resulting veto is dependent on the edm::Event, the value of the second pointer will be set to non-zero Note that both pointers will point to the same object, so you have to delete it only once.

Definition at line 84 of file IsoDepositVetoFactory.cc.

References Exception, first, make(), edm::match(), and dimuonsSequences_cff::threshold.

00084                                                                                            {
00085     using namespace reco::isodeposit;
00086     static boost::regex 
00087         ecalSwitch("^Ecal(Barrel|Endcaps):(.*)"),
00088         threshold("Threshold\\((\\d+\\.\\d+)\\)"),
00089         thresholdtransverse("ThresholdFromTransverse\\((\\d+\\.\\d+)\\)"),
00090         absthreshold("AbsThreshold\\((\\d+\\.\\d+)\\)"),
00091         absthresholdtransverse("AbsThresholdFromTransverse\\((\\d+\\.\\d+)\\)"),
00092         cone("ConeVeto\\((\\d+\\.\\d+)\\)"),
00093         angleCone("AngleCone\\((\\d+\\.\\d+)\\)"),
00094         angleVeto("AngleVeto\\((\\d+\\.\\d+)\\)"),
00095         rectangularEtaPhiVeto("RectangularEtaPhiVeto\\(([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+)\\)"),
00096         numCrystal("NumCrystalVeto\\((\\d+\\.\\d+)\\)"),
00097         numCrystalEtaPhi("NumCrystalEtaPhiVeto\\((\\d+\\.\\d+),(\\d+\\.\\d+)\\)"),
00098         otherCandidates("OtherCandidatesByDR\\((\\w+:?\\w*:?\\w*),\\s*(\\d+\\.?|\\d*\\.\\d*)\\)"),
00099         number("^(\\d+\\.?|\\d*\\.\\d*)$");
00100     boost::cmatch match;
00101     
00102     evdep = 0; // by default it does not depend on this
00103     if (regex_match(string, match, ecalSwitch)) {
00104         return new SwitchingEcalVeto(make(match[2].first), (match[1] == "Barrel") );
00105     } else if (regex_match(string, match, threshold)) {
00106         return new ThresholdVeto(atof(match[1].first));
00107     } else if (regex_match(string, match, thresholdtransverse)) {
00108         return new ThresholdVetoFromTransverse(atof(((std::string)match[1]).c_str()));
00109     } else if (regex_match(string, match, absthreshold)) {
00110         return new AbsThresholdVeto(atof(match[1].first));
00111     } else if (regex_match(string, match, absthresholdtransverse)) {
00112         return new AbsThresholdVetoFromTransverse(atof(((std::string)match[1]).c_str()));
00113     } else if (regex_match(string, match, cone)) {
00114         return new ConeVeto(Direction(), atof(match[1].first));
00115     } else if (regex_match(string, match, number)) {
00116         return new ConeVeto(Direction(), atof(match[1].first));
00117     } else if (regex_match(string, match, angleCone)) {
00118         return new AngleCone(Direction(), atof(match[1].first));
00119     } else if (regex_match(string, match, angleVeto)) {
00120         return new AngleConeVeto(Direction(), atof(match[1].first));
00121     } else if (regex_match(string, match, rectangularEtaPhiVeto)) {
00122         return new RectangularEtaPhiVeto(Direction(), 
00123                     atof(match[1].first), atof(match[2].first), 
00124                     atof(match[3].first), atof(match[4].first));
00125     } else if (regex_match(string, match, numCrystal)) {
00126         return new NumCrystalVeto(Direction(), atof(match[1].first));
00127     } else if (regex_match(string, match, numCrystalEtaPhi)) {
00128         return new NumCrystalEtaPhiVeto(Direction(),atof(match[1].first),atof(match[2].first));
00129     } else if (regex_match(string, match, otherCandidates)) {
00130         OtherCandidatesDeltaRVeto *ret = new OtherCandidatesDeltaRVeto(edm::InputTag(match[1]), 
00131                                                                         atof(match[2].first));
00132         evdep = ret;
00133         return ret;
00134     } else {
00135         throw cms::Exception("Not Implemented") << "Veto " << string << " not implemented yet...";
00136     }
00137 }

reco::isodeposit::AbsVeto * IsoDepositVetoFactory::make ( const char *  string  )  [static]

Returns a pointer to an AbsVeto defined by the string.

The calling code owns the pointer, and must delete it at the end. An exception will be thrown if the resulting AbsVeto depends on the edm::Event

Definition at line 73 of file IsoDepositVetoFactory.cc.

References Exception.

Referenced by pat::helper::IsoDepositIsolator::IsoDepositIsolator(), make(), and CandIsolatorFromDeposits::SingleDeposit::SingleDeposit().

00073                                               {
00074     reco::isodeposit::EventDependentAbsVeto * evdep = 0;
00075     std::auto_ptr<reco::isodeposit::AbsVeto> ret(make(string,evdep));
00076     if (evdep != 0) {
00077         throw cms::Exception("Configuration") << "The resulting AbsVeto depends on the edm::Event.\n" 
00078                                               << "Please use the two-arguments IsoDepositVetoFactory::make.\n";
00079     }
00080     return ret.release();
00081 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:25:55 2009 for CMSSW by  doxygen 1.5.4