Public Member Functions | Protected Attributes | List of all members
caldp::AttenProfilesMap Class Reference

AttenProfiles for many channels. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-02/CalibrationDataProducts/AttenProfiles.h"

Public Member Functions

 AttenProfilesMap ()
 
 AttenProfilesMap (float w0, float w1)
 
 AttenProfilesMap (const AttenProfiles &)=delete
 
bool HasProfiles (const geo::OfflineChan &c) const
 
bool HasProfiles (int plane, int cell) const
 
AttenProfilesGetProfiles (const geo::OfflineChan &c)
 
AttenProfilesGetProfiles (int plane, int cell)
 
std::vector< geo::OfflineChanChannels () const
 List of channels with profiles on. More...
 
std::map< int, std::map< int, std::vector< TH1F * > > > GetAllProfilesByPlaneAndCell ()
 Intended for writing out/drawing all the histograms. More...
 
AttenProfilesMapoperator+= (const AttenProfilesMap &rhs)
 
void Clear ()
 
double MinW () const
 
double MaxW () const
 

Protected Attributes

float fMinW
 
float fMaxW
 
std::map< geo::OfflineChan, AttenProfilesfMap
 

Detailed Description

AttenProfiles for many channels.

Definition at line 89 of file AttenProfiles.h.

Constructor & Destructor Documentation

caldp::AttenProfilesMap::AttenProfilesMap ( )
inline
caldp::AttenProfilesMap::AttenProfilesMap ( float  w0,
float  w1 
)

Definition at line 160 of file AttenProfiles.cxx.

caldp::AttenProfilesMap::AttenProfilesMap ( const AttenProfiles )
delete

Member Function Documentation

std::vector< geo::OfflineChan > caldp::AttenProfilesMap::Channels ( ) const

List of channels with profiles on.

Definition at line 192 of file AttenProfiles.cxx.

References fMap, it, and runNovaSAM::ret.

Referenced by calib::AttenFit::ConsolidateViews(), calib::AttenuationFit::ConsolidateViews(), calib::AttenuationFit::readResults(), and calib::AttenuationFit::writeResults().

193  {
194  std::vector<geo::OfflineChan> ret;
195  ret.reserve(fMap.size());
196  for(auto& it: fMap) ret.push_back(it.first);
197  return ret;
198  }
set< int >::iterator it
std::map< geo::OfflineChan, AttenProfiles > fMap
void caldp::AttenProfilesMap::Clear ( )

Definition at line 260 of file AttenProfiles.cxx.

References fMap.

Referenced by calib::AttenFit::ConsolidateViews(), and calib::AttenuationFit::ConsolidateViews().

261  {
262  fMap.clear();
263  }
std::map< geo::OfflineChan, AttenProfiles > fMap
std::map< int, std::map< int, std::vector< TH1F * > > > caldp::AttenProfilesMap::GetAllProfilesByPlaneAndCell ( )

Intended for writing out/drawing all the histograms.

Definition at line 202 of file AttenProfiles.cxx.

References getBrightness::cell, fMap, genie::utils::style::Format(), it, NDAPDHVSetting::plane, runNovaSAM::ret, caldp::LiteProfile::TotalHits(), caldp::LiteProfile::ToTH1F(), registry_explorer::v, caldp::AttenProfiles::WPE_corr_traj, caldp::AttenProfiles::WPE_corr_xy, and caldp::AttenProfiles::WPE_corr_z.

203  {
204  std::map<int, std::map<int, std::vector<TH1F*>>> ret;
205  for(auto& it: fMap){
206  const int plane = it.first.Plane();
207  const int cell = it.first.Cell();
208  const AttenProfiles& hs = it.second;
209  std::vector<TH1F*>& v = ret[plane][cell];
210  /* if(hs.WPE.TotalHits()){
211  v.push_back(hs.WPE.ToTH1F());
212  v.back()->SetName(TString::Format("h_WPE_%03d_%03d", plane, cell));
213  v.back()->SetTitle(TString::Format("Plane %d, Cell %d;W;PE", plane, cell));
214  }
215 
216  if(hs.WPE_corr.TotalHits()){
217  v.push_back(hs.WPE_corr.ToTH1F());
218  v.back()->SetName(TString::Format("h_WPE_corr_avg_%03d_%03d", plane, cell));
219  v.back()->SetTitle(TString::Format("Avg Corr, Plane %d, Cell %d;W;PE/cm", plane, cell));
220  }*/
221 
222  if(hs.WPE_corr_xy.TotalHits()){
223  v.push_back(hs.WPE_corr_xy.ToTH1F());
224  v.back()->SetName(TString::Format("h_WPE_corr_xy_%03d_%03d", plane, cell));
225  v.back()->SetTitle(TString::Format("XY, Plane %d, Cell %d;W;PE/cm", plane, cell));
226  }
227 
228  if(hs.WPE_corr_z.TotalHits()){
229  v.push_back(hs.WPE_corr_z.ToTH1F());
230  v.back()->SetName(TString::Format("h_WPE_corr_z_%03d_%03d", plane, cell));
231  v.back()->SetTitle(TString::Format("Z, Plane %d, Cell %d;W;PE/cm", plane, cell));
232  }
233 
234  if(hs.WPE_corr_traj.TotalHits()){
235  v.push_back(hs.WPE_corr_traj.ToTH1F());
236  v.back()->SetName(TString::Format("h_WPE_corr_traj_%03d_%03d", plane, cell));
237  v.back()->SetTitle(TString::Format("Traj, Plane %d, Cell %d;W;PE/cm", plane, cell));
238  }
239 
240  /*
241  if(hs.WPE_corr_xy_truth.TotalHits()){
242  v.push_back(hs.WPE_corr_xy_truth.ToTH1F());
243  v.back()->SetName(TString::Format("h_WPE_corr_xy_truth_%03d_%03d", plane, cell));
244  v.back()->SetTitle(TString::Format("XY, Plane %d, Cell %d;W;MeV/cm", plane, cell));
245  }*/
246  }
247  return ret;
248  }
set< int >::iterator it
std::map< geo::OfflineChan, AttenProfiles > fMap
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
AttenProfiles & caldp::AttenProfilesMap::GetProfiles ( const geo::OfflineChan c)

Definition at line 175 of file AttenProfiles.cxx.

References fMap, fMaxW, fMinW, it, and make_pair().

Referenced by calib::AttenFit::ConsolidateViews(), calib::AttenuationFit::ConsolidateViews(), calib::AttenFit::endJob(), GetProfiles(), operator+=(), and calib::AttenuationFit::writeResults().

176  {
177  auto it = fMap.find(c);
178  if(it != fMap.end()) return it->second;
179 
180  fMap.emplace(std::make_pair(c, AttenProfiles(fMinW, fMaxW)));
181  return fMap.find(c)->second;
182  }
set< int >::iterator it
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::map< geo::OfflineChan, AttenProfiles > fMap
AttenProfiles & caldp::AttenProfilesMap::GetProfiles ( int  plane,
int  cell 
)

Definition at line 185 of file AttenProfiles.cxx.

References GetProfiles().

186  {
188  }
A (plane, cell) pair.
Definition: OfflineChan.h:17
AttenProfiles & GetProfiles(const geo::OfflineChan &c)
bool caldp::AttenProfilesMap::HasProfiles ( const geo::OfflineChan c) const

Definition at line 163 of file AttenProfiles.cxx.

References fMap.

Referenced by calib::AttenFit::endJob(), HasProfiles(), and calib::AttenuationFit::writeResults().

164  {
165  return fMap.find(c) != fMap.end();
166  }
std::map< geo::OfflineChan, AttenProfiles > fMap
bool caldp::AttenProfilesMap::HasProfiles ( int  plane,
int  cell 
) const

Definition at line 169 of file AttenProfiles.cxx.

References HasProfiles().

170  {
172  }
bool HasProfiles(const geo::OfflineChan &c) const
A (plane, cell) pair.
Definition: OfflineChan.h:17
double caldp::AttenProfilesMap::MaxW ( ) const
inline
double caldp::AttenProfilesMap::MinW ( ) const
inline
AttenProfilesMap & caldp::AttenProfilesMap::operator+= ( const AttenProfilesMap rhs)

Definition at line 251 of file AttenProfiles.cxx.

References fMap, GetProfiles(), and it.

252  {
253  for(auto & it: rhs.fMap){
254  GetProfiles(it.first) += it.second;
255  }
256  return *this;
257  }
set< int >::iterator it
AttenProfiles & GetProfiles(const geo::OfflineChan &c)

Member Data Documentation

std::map<geo::OfflineChan, AttenProfiles> caldp::AttenProfilesMap::fMap
protected
float caldp::AttenProfilesMap::fMaxW
protected

Definition at line 120 of file AttenProfiles.h.

Referenced by GetProfiles().

float caldp::AttenProfilesMap::fMinW
protected

Definition at line 120 of file AttenProfiles.h.

Referenced by GetProfiles().


The documentation for this class was generated from the following files: