|
ATLAS Offline Software
|
Go to the documentation of this file.
50 ATH_MSG_ERROR(
"failed to properly add softTrk affecting systematics " );
51 return StatusCode::FAILURE;
58 ATH_MSG_ERROR(
"failed to properly add softCalo affecting systematics " );
59 return StatusCode::FAILURE;
65 ATH_MSG_ERROR(
"failed to properly add jetTrk affecting systematics " );
66 return StatusCode::FAILURE;
75 ATH_MSG_DEBUG(
"These systematics are set based on your config files: " );
80 return StatusCode::SUCCESS;
93 if (lastchar !=
'/') {
99 m_configJetTrkFile.empty() )
ATH_MSG_WARNING(
"you have initialized the METSystematicsTool with no configuration file. The tool will do nothing. Please set the configuration file properties.");
111 ATH_MSG_INFO(
"Doing SoftCalo systematics initialization. THIS IS FOR SOFTWARE DEVELOPMENT ONLY.");
112 ATH_MSG_INFO(
"CST IS NOT YET RECOMMENDED OR SUPPORTED BY THE MET GROUP. YOU ARE USING A 2012 config file.");
115 std::string gsystpath =
"";
117 std::string blank =
"";
123 ATH_MSG_INFO(
"METSystematics: Read calo uncertainties" );
133 return StatusCode::FAILURE;
140 return StatusCode::SUCCESS;
149 std::string gsystpath =
"";
150 std::string configdir =
"";
151 std::string blank =
"";
155 TFile
infile((configdir).c_str());
163 return StatusCode::FAILURE;
169 return StatusCode::SUCCESS;
178 std::string psystpath =
"";
197 return StatusCode::FAILURE;
205 return StatusCode::SUCCESS;
214 if( systSet.
empty() ) {
216 return StatusCode::SUCCESS;
217 }
else if( systSet.
size() > 1 ) {
218 ATH_MSG_WARNING(
"Tool does not support multiple systematics, returning unsupported" );
219 return StatusCode::FAILURE;
235 return StatusCode::FAILURE;
240 return StatusCode::SUCCESS;
251 ATH_MSG_WARNING(
"event info is empty, returning without applying correction");
256 ATH_MSG_WARNING(
"This tool should be applied to MC only. Return without changing the input MET object");
263 if(METcont ==
nullptr){
264 ATH_MSG_WARNING(
"MissingET object not owned by a container. Returning without applying correction" );
274 if(
helper.map() ==
nullptr) {
275 ATH_MSG_WARNING(
"The MissingETAssociationMap for the given MissingETAssociationHelper is null. Returning without applying correction ");
282 ATH_MSG_WARNING(
"METSystematicsTool received a MissingET object it can't correct. You should only pass soft MET terms or jet track MET terms.");
292 if(outputmet !=
nullptr ){
293 ATH_MSG_WARNING(
"Please pass a nullptr to the 2nd argument of correctedCopy to fill the output pointer");
305 ATH_MSG_WARNING(
"This tool should be applied to MC only. Return without changing the input MET object");
312 if(METcont ==
nullptr){
313 ATH_MSG_WARNING(
"MissingET object not owned by a container. Unable to apply correction, returning output MET object as null" );
320 outputmet =
nullptr;
delete copy;
326 if(
helper.map() ==
nullptr) {
327 ATH_MSG_WARNING(
"MissingETAssociationHelper contained a null MissingETAssociationMap pointer");
328 outputmet =
nullptr;
delete copy;
334 outputmet =
nullptr;
delete copy;
352 ATH_MSG_ERROR(
"not soft met, cannot apply soft term correction to this MET");
360 <<
", met = " << softMet.
met()
362 <<
", do syst? " << doSyst);
366 <<
", met = " << softMet.
met()
368 <<
", do syst? " << doSyst);
376 softMetStruct.
mpx = softMet.
mpx();
377 softMetStruct.
mpy = softMet.
mpy();
379 softMetStruct.
name = softMet.
name();
382 if(METcont ==
nullptr){
383 ATH_MSG_WARNING(
"failed to retrieve MET container from passed object");
388 double const ptHardMet = std::sqrt( ptHard.
mpx * ptHard.
mpx +
389 ptHard.
mpy * ptHard.
mpy ) ;
392 size_t njet = (jetterm==
nullptr) ? 0 : acc_constitObjLinks(*jetterm ).size();
417 softMetStruct =
softTrkSyst_reso(softMetStruct, ptHard, ptHardShift, smearpara, 0.);
422 softMetStruct =
softTrkSyst_reso(softMetStruct, ptHard, ptHardShift, 0., smearperp );
428 softMetStruct =
softTrkSyst_reso(softMetStruct, ptHard, ptHardShift, smearpara , smearperp);
446 ATH_MSG_DEBUG(
"No systematic applied, returning nominal MET term");
461 <<
", met = " << softMet.
met() );
474 ATH_MSG_ERROR(
"jet track systematics histogram not initialized properly.") ;
504 jettrkmet.
setMpx ( jettrkmet.
mpx() - trkvec.
cpx() * uncert);
505 jettrkmet.
setMpy ( jettrkmet.
mpy() - trkvec.
cpy() * uncert);
518 ATH_MSG_ERROR(
"jet track systematics histogram not initialized properly.") ;
526 std::vector<const xAOD::Jet*>
jets;
527 for(
const iplink_t& jetlink : acc_constitObjLinks(jettrkmet)) {
529 ATH_MSG_ERROR(
"Invalid object of type " << (*jetlink)->type() <<
" in jet term");
534 bool originalInputs =
jets.empty() ? false : !acc_originalObject.isAvailable(*
jets.front());
546 if(std::abs(
jet->eta())<=2.5)
558 uncert = std::sqrt(uncert*uncert+uncert_frac*uncert_frac);
580 jettrkmet.
setMpx ( jettrkmet.
mpx()*(1 + uncert/(std::abs(jettrkmet.
mpx())*std::sqrt(2))));
581 jettrkmet.
setMpy ( jettrkmet.
mpy()*(1 + uncert/(std::abs(jettrkmet.
mpy())*std::sqrt(2))));
597 ATH_MSG_ERROR(
"MissingETAssociationMap null, error calculating jet track systematics.");
619 double const metSigma = .7 * std::sqrt(softTerms.
sumet);
621 double const smearedSigma = std::sqrt( (metSigma* (1. + resUnc))*(metSigma* (1. + resUnc)) -
622 metSigma * metSigma );
624 ATH_MSG_VERBOSE(
"caloSyst_reso: metSigma: " << metSigma <<
", resUnc: " << resUnc <<
", smearedSigma = " << smearedSigma);
626 double const softTermsMet = std::sqrt( softTerms.
mpx * softTerms.
mpx +
627 softTerms.
mpy * softTerms.
mpy );
631 double const shift = softTermsMet<1
e-9 ? 0. :
rand*smearedSigma / softTermsMet;
647 double const smearpara,
648 double const smearperp)
const{
652 projection.
mpx = (projection.
mpx + shift + smearpara );
653 projection.
mpy = (projection.
mpy + + smearperp );
661 double const ptHardMet = std::sqrt( ptHard.
mpx * ptHard.
mpx +
662 ptHard.
mpy * ptHard.
mpy );
664 double const ux = ptHard.
mpx/ptHardMet;
665 double const uy = ptHard.
mpy/ptHardMet;
666 double const projL = ux*softTerms.
mpx + uy*softTerms.
mpy;
667 double const projT = uy*softTerms.
mpx - ux*softTerms.
mpy;
687 if(truthiter == truthCont->
end()){
694 ptHard.
mpx = truthmet.
mpx();
695 ptHard.
mpy = truthmet.
mpy();
704 ptHard.
mpx -= (*iMET)->mpx();
705 ptHard.
mpy -= (*iMET)->mpy();
706 ptHard.
sumet += (*iMET)->sumet();
710 if( ptHard.
sumet < 0 ) {
711 ATH_MSG_ERROR(
"PtHard has a negative sumet, returning ptHart = 0");
720 if(ptHard.
sumet<1.0e-6){
730 std::string & systpath ,
739 std::string configpath =
"";
740 std::string configfile =
"";
756 ATH_MSG_INFO(
"Searching for configFile: " << configfile);
758 ATH_MSG_DEBUG(
"CALIBPATH: " << gSystem->Getenv(
"CALIBPATH") );
760 if(configpath.empty() || configfile.empty() ){
762 return StatusCode::FAILURE;
765 if(
reader.ReadFile(configpath.c_str(),EEnvLevel(0)) < 0) {
767 return StatusCode::FAILURE;
770 ATH_MSG_INFO(
"Configuring from file : " << configpath );
776 systpath =
reader.GetValue(
"GlobalSyst.sourcedir" ,
"" );
780 systpath =
reader.GetValue(
"PtHardSyst.sourcedir" ,
"" );
792 std::string
const units_string =
reader.GetValue(
"Units",
"" );
796 if(units_string !=
"GeV"){
797 ATH_MSG_ERROR(
"initialized the different systematics using two config files that conflict on units");
798 return StatusCode::FAILURE;
802 if( (!units_string.empty()) &&
803 (units_string !=
"MeV")
805 ATH_MSG_ERROR(
"initialized the different systematics using two config files that conflict on units");
806 return StatusCode::FAILURE;
811 if( (units_string.empty()) ||
812 (units_string ==
"MeV")
815 }
else if(units_string ==
"GeV"){
818 ATH_MSG_ERROR(
"You specified an incorrect 'Units' value. Please specify MeV , GeV , or leave it blank for MeV");
819 return StatusCode::FAILURE;
828 ATH_MSG_ERROR(
"Failed to correctly set histfile path, or path to histograms inside of the histfile" );
829 return StatusCode::FAILURE;
837 ATH_MSG_ERROR(
"Something is wrong with your units initialization. Please contact the developers (you should never get here).");
838 return StatusCode::FAILURE;
842 return StatusCode::SUCCESS;
853 ATH_MSG_ERROR(
"Failed to retrieve default EventInfo object");
864 ATH_MSG_ERROR(
"Failed to retrieve default NPV value from PrimaryVertices");
870 for (itr = vertices->
begin(); itr != vertices->
end(); ++itr)
879 random =
new TRandom3();
Const iterator class for DataVector/DataList.
void setSumet(float value)
Set .
MET association descriptor contains object links and corresponding parameters.
float sumet() const
Returns.
size_t size() const
returns: size of the set
void setMpy(float value)
Set the component.
bool empty() const
returns: whether the set is empty
static bool isTotalTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Class to wrap a set of SystematicVariations.
MissingET_v1 MissingET
Version control by type defintion.
MissingETBase::Types::bitmask_t source
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Helper class to provide constant type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
bool const RAWDATA *ch2 const
Class providing the definition of the 4-vector interface.
static bool isTrackTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
@ IS_SIMULATION
true: simulation, false: data
void setSource(MissingETBase::Types::bitmask_t src)
Set the source of the MET object.
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
static bool isJetTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Vector sum of constituents for subtractive overlap removal.
void setName(const std::string &name)
Set the name of the MET object.
const_iterator find(const std::string &name) const
Find non-modifiable MET object by name.
@ Error
Some error happened during the object correction.
static Types::bitmask_t jet(Region reg=Region::FullAcceptance)
Standard MET term from reconstructed jets.
::StatusCode StatusCode
StatusCode definition for legacy code.
float cpy() const
Returns .
float sumpt() const
Returns sum of component pt.
Principal data object for Missing ET.
float mpx() const
Returns .
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const std::string & name() const
Identifier getters.
void setMpx(float value)
Set the component.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ConstVec jetTrkVec() const
Get track constituent vector for the reference jet.
Container for xAOD::MissingET_v1 objects.
MissingETBase::Types::bitmask_t source() const
MET object source tag.
static const MissingETAssociation * getAssociation(const MissingETAssociationMap *pMap, const Jet *pJet)
ConstVec overlapTrkVec(const MissingETAssociationHelper &helper) const
Retrieve total track-based vector to be subtracted from the jet.
Class describing the basic event information.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
@ Ok
The correction was done successfully.
static Types::bitmask_t truthNonInt()
Standard bit pattern indicating genuine true MET.
#define ATH_MSG_WARNING(x)
const_iterator begin() const
description: const iterator to the beginning of the set
Return value from object correction CP tools.
const SG::AuxVectorData * container() const
Return the container holding this element.
float cpx() const
Returns .
reader
read the goodrunslist xml file(s)
float mpy() const
Returns .
static bool isSoftTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Jet_v1 Jet
Definition of the current "jet version".
float met() const
Returns .
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.