|
|
Go to the documentation of this file.
9 #include <boost/format.hpp>
34 if (strcasecmp(splitmode.c_str(),
"NearestLayer") == 0) {
36 }
else if (strcasecmp(splitmode.c_str(),
"InnerLayer") == 0) {
38 }
else if (strcasecmp(splitmode.c_str(),
"OuterLayer") == 0) {
43 <<
"Invalid SplitMode \"" << splitmode
44 <<
"\". Acceptable values are \"NearestLayer\", \"InnerLayer\", \"OuterLayer\".";
77 for (
unsigned int i = 0;
i <
m_groups.size(); ++
i) {
103 std::ofstream xml(
name);
104 xml <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" << std::endl;
105 xml <<
"<Groups>" << std::endl;
106 for (
unsigned int i = 0;
i <
m_groups.size(); ++
i) {
108 xml <<
" <Group name=\"" << layer.
name() <<
"\">\n"
110 <<
" <Parameter name=\"TrackerXi\" value=\"" << layer.
averageEnergyLoss() <<
"\"/>\n"
114 xml <<
"</Groups>" << std::endl;
119 for (
unsigned int i = 0;
i <
m_groups.size(); ++
i) {
158 LogInfo(
"TrackingMaterialAnalyser") <<
"TrackingMaterialAnalyser: List of the tracker groups: " << std::endl;
160 LogInfo(
"TrackingMaterialAnalyser") <<
i <<
" TrackingMaterialAnalyser:\t" <<
m_groups[
i]->info() << std::endl;
165 for (std::vector<MaterialAccountingTrack>::const_iterator
t = h_tracks->begin(),
end = h_tracks->end();
t !=
end;
184 std::vector<int>
group(
track.detectors().size());
185 for (
unsigned int i = 0;
i <
track.detectors().size(); ++
i)
188 for (
unsigned int i = 0;
i <
group.size(); ++
i)
190 LogInfo(
"TrackingMaterialAnalyser") <<
"For detector i: " <<
i <<
" index: " <<
group[
i]
191 <<
" R-ranges: " <<
m_groups[
group[
i] - 1]->getBoundingR().first <<
", "
193 <<
" Z-ranges: " <<
m_groups[
group[
i] - 1]->getBoundingZ().first <<
", "
201 for (
unsigned int i = 1;
i <
track.steps().size(); ++
i)
204 const double TOLERANCE = 0.0001;
209 limits[0] =
track.detectors()[0].m_curvilinearIn - TOLERANCE;
224 limits[
i] = (
track.detectors()[
i - 1].m_curvilinearOut +
track.detectors()[
i].m_curvilinearIn) / 2.;
232 limits[
i] =
track.detectors()[
i].m_curvilinearIn - TOLERANCE;
239 limits[
i] =
track.detectors()[
i - 1].m_curvilinearOut + TOLERANCE;
266 unsigned int index = 0;
267 while (
i <
track.steps().size()) {
286 std::cerr <<
"MaterialAccountingTrack::split(): ERROR: internal logic error, expected " <<
limits[
index]
300 std::pair<MaterialAccountingStep, MaterialAccountingStep>
parts =
step.split(
fraction);
326 for (
unsigned int i = 0;
i <
track.detectors().size(); ++
i)
349 std::cerr <<
"TrackingMaterialAnalyser::findLayer(...): ERROR: detector does not belong to any DetLayer"
352 <<
" (r: " << std::setprecision(1) << std::setw(5) <<
detector.position().perp()
353 <<
", z: " << std::setprecision(1) << std::setw(6) <<
detector.position().z()
354 <<
", phi: " << std::setprecision(3) << std::setw(6) <<
detector.position().phi() <<
")" << std::endl;
358 std::cerr <<
"TrackingMaterialAnalyser::findLayer(...): ERROR: detector belongs to " << inside <<
" DetLayers"
361 <<
" (r: " << std::setprecision(1) << std::setw(5) <<
detector.position().perp()
362 <<
", z: " << std::setprecision(1) << std::setw(6) <<
detector.position().z()
363 <<
", phi: " << std::setprecision(3) << std::setw(6) <<
detector.position().phi() <<
")" << std::endl;
std::vector< std::string > m_groupNames
const std::string & name(void) const
get the layer name
def detectors(dt=True, csc=True, me42=False, chambers=True, superlayers=False, layers=False)
double sigmaEnergyLoss(void) const
return the sigma of the normalized energy loss density factor for Bethe-Bloch
void analyze(const edm::Event &, const edm::EventSetup &) override
double averageRadiationLengths(void) const
return the average normalized number of radiation lengths
void plotSegmentUnassigned(const MaterialAccountingStep &step)
int findLayer(const MaterialAccountingDetector &detector)
void saveXml(const char *name)
double sigmaRadiationLengths(void) const
return the sigma of the normalized number of radiation lengths
#define DEFINE_FWK_MODULE(type)
TrackingMaterialAnalyser(const edm::ParameterSet &)
TrackingMaterialPlotter * m_plotter
double averageEnergyLoss(void) const
return the average normalized energy loss density factor for Bethe-Bloch
bool m_skipBeforeFirstDetector
void plotSegmentInLayer(const MaterialAccountingStep &step, int layer)
double sigmaLength(void) const
return the sigma of the normalized layer thickness
unsigned int tracks(void) const
return the number of tracks that hit this layer
T getParameter(std::string const &) const
edm::EDGetTokenT< std::vector< MaterialAccountingTrack > > m_materialToken
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void savePlots(void)
save the plots
void saveParameters(const char *name)
bool m_skipAfterLastDetector
double averageLength(void) const
return the average normalized layer thickness
std::vector< MaterialAccountingGroup * > m_groups
~TrackingMaterialAnalyser() override
void split(MaterialAccountingTrack &track)