9 #include <boost/tuple/tuple.hpp>
10 #include <boost/format.hpp>
11 #include <boost/filesystem.hpp>
35 if (strcasecmp(splitmode.c_str(),
"NearestLayer") == 0) {
37 }
else if (strcasecmp(splitmode.c_str(),
"InnerLayer") == 0) {
39 }
else if (strcasecmp(splitmode.c_str(),
"OuterLayer") == 0) {
51 if (m_saveSummaryPlot)
69 for (
unsigned int i = 0;
i <
m_groups.size(); ++
i) {
76 parameters <<
boost::format(
"%-20s\t%7d\t%5.1f ± %5.1f cm\t%6.4f ± %6.4f \t%6.4fe-03 ± %6.4fe-03 GeV")
92 std::ofstream xml(name);
93 xml <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" << std::endl;
94 xml <<
"<Groups>" << std::endl;
95 for (
unsigned int i = 0;
i <
m_groups.size(); ++
i) {
97 xml <<
" <Group name=\"" << layer.
name() <<
"\">\n"
99 <<
" <Parameter name=\"TrackerXi\" value=\"" << layer.
averageEnergyLoss() <<
"\"/>\n"
103 xml <<
"</Groups>" << std::endl;
109 if (boost::filesystem::is_directory(name))
110 boost::filesystem::remove_all(name);
111 boost::filesystem::create_directory(name);
112 for (
unsigned int i = 0;
i <
m_groups.size(); ++
i) {
132 m_plotter->normalize();
166 std::cout <<
"TrackingMaterialAnalyser: List of the tracker groups: " << std::endl;
167 for (
unsigned int i = 0; i <
m_groups.size(); ++
i)
175 for (std::vector<MaterialAccountingTrack>::const_iterator
t = h_tracks->begin(),
end = h_tracks->end();
t !=
end; ++
t) {
191 std::vector<int> group( track.
m_detectors.size() );
196 if (detectors == 0) {
200 for (
unsigned int i = 1;
i < track.
m_steps.size(); ++
i)
203 const double TOLERANCE = 0.0001;
204 std::vector<double> limits(detectors + 2);
208 limits[0] = track.
m_detectors[0].m_curvilinearIn - TOLERANCE;
210 limits[0] = - TOLERANCE;
215 limits[detectors+1] = INFINITY;
230 limits[
i] = track.
m_detectors[
i].m_curvilinearIn - TOLERANCE;
237 limits[
i] = track.
m_detectors[
i-1].m_curvilinearOut + TOLERANCE;
255 while (end < limits[0]) {
257 end = begin + step.
length();
270 if (begin < limits[0] and end > limits[0]) {
272 end = begin + step.
length();
274 double fraction = (limits[0] -
begin) / (end - begin);
275 std::pair<MaterialAccountingStep, MaterialAccountingStep>
parts = step.
split(fraction);
278 track.
m_detectors[0].account( parts.second, limits[1], end );
290 unsigned int index = 0;
291 while (i < track.
m_steps.size()) {
294 end = begin + step.
length();
296 if (begin > limits[detectors]) {
308 if (begin < limits[index]
or end > limits[index+2]) {
310 std::cerr <<
"MaterialAccountingTrack::split(): ERROR: internal logic error, expected " << limits[
index] <<
" < " << begin <<
" < " << limits[index+1] << std::endl;
315 if (limits[index] <= begin and end <= limits[index+1]) {
322 double fraction = (limits[index+1] -
begin) / (end - begin);
323 std::pair<MaterialAccountingStep, MaterialAccountingStep>
parts = step.
split(fraction);
332 if (index+1 < detectors)
343 if (index < detectors)
375 std::cerr <<
"TrackingMaterialAnalyser::findLayer(...): ERROR: detector does not belong to any DetLayer" << std::endl;
376 std::cerr <<
"TrackingMaterialAnalyser::findLayer(...): detector position: " << std::fixed
377 <<
" (r: " << std::setprecision(1) << std::setw(5) << detector.
position().
perp()
378 <<
", z: " << std::setprecision(1) << std::setw(6) << detector.
position().
z()
379 <<
", phi: " << std::setprecision(3) << std::setw(6) << detector.
position().
phi() <<
")"
384 std::cerr <<
"TrackingMaterialAnalyser::findLayer(...): ERROR: detector belongs to " << inside <<
"DetLayers" << std::endl;
385 std::cerr <<
"TrackingMaterialAnalyser::findLayer(...): detector position: " << std::fixed
386 <<
" (r: " << std::setprecision(1) << std::setw(5) << detector.
position().
perp()
387 <<
", z: " << std::setprecision(1) << std::setw(6) << detector.
position().
z()
388 <<
", phi: " << std::setprecision(3) << std::setw(6) << detector.
position().
phi() <<
")"
void plotSegmentUnassigned(const MaterialAccountingStep &step)
T getParameter(std::string const &) const
bool m_skipAfterLastDetector
double averageRadiationLengths(void) const
return the average normalized number of radiation lengths
std::vector< MaterialAccountingDetector > m_detectors
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
edm::ESWatcher< IdealGeometryRecord > m_geometryWatcher
double sigmaLength(void) const
return the sigma of the normalized layer thickness
#define DEFINE_FWK_MODULE(type)
double sigmaRadiationLengths(void) const
return the sigma of the normalized number of radiation lengths
std::vector< MaterialAccountingStep > m_steps
Geom::Phi< T > phi() const
double length(void) const
double sigmaEnergyLoss(void) const
return the sigma of the normalized energy loss density factor for Bethe-Bloch
MaterialAccountingStep m_total
void split(MaterialAccountingTrack &track)
unsigned int tracks(void) const
return the number of tracks that hit this layer
double averageLength(void) const
return the average normalized layer thickness
void saveXml(const char *name)
void saveParameters(const char *name)
void saveLayerPlots(const char *name)
int findLayer(const MaterialAccountingDetector &detector)
double averageEnergyLoss(void) const
return the average normalized energy loss density factor for Bethe-Bloch
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
const std::string & name(void) const
get the layer name
std::vector< std::string > m_groupNames
TrackingMaterialPlotter * m_plotter
void savePlots(const char *directory)
save the plots
std::vector< MaterialAccountingGroup * > m_groups
bool m_skipBeforeFirstDetector
std::pair< MaterialAccountingStep, MaterialAccountingStep > split(double fraction) const
split the step (0..1) in (0..f) + (f..1) using linear interpolation
bool check(const edm::EventSetup &iSetup)
const GlobalPoint & position() const
TrackingMaterialAnalyser(const edm::ParameterSet &)
void plotSegmentInLayer(const MaterialAccountingStep &step, int layer)
void analyze(const edm::Event &, const edm::EventSetup &)
virtual ~TrackingMaterialAnalyser()
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")