15 #include <QtCore/QString>
30 using std::tr1::dynamic_pointer_cast;
31 using std::tr1::shared_ptr;
52 const HelperAcqirisDetectors::helperinstancesmap_t::key_type &
detector,
53 const std::string &layerKey,
58 DelaylineDetector::anodelayers_t::key_type layer
60 if (layer !=
'U' && layer !=
'V' && layer !=
'W' &&
61 layer !=
'X' && layer !=
'Y')
63 throw invalid_argument(
"pp" +
toString(ppNbr) +
"::loadSettings()'" + key +
64 "': The loaded value of '" + layerKey +
"' '"+ layer +
65 "' does not exist. Can only be 'U', 'V', 'W', 'X' or 'Y'");
67 else if (dynamic_cast<const DelaylineDetector&>(dethelp->detector()).isHex())
69 if (layer ==
'X' || layer ==
'Y')
70 throw invalid_argument(
"pp"+
toString(ppNbr) +
"::loadSettings()'"+ key +
71 "': Detector '" + detector +
72 "' is Hex-detector and cannot have Layer '" +layer +
"'");
76 if (layer ==
'U' || layer ==
'V' || layer ==
'W')
77 throw invalid_argument(
"pp" +
toString(ppNbr) +
"::loadSettings()'" + key +
78 "': Detector '" + detector +
79 "' is Quad-detector and cannot have Layer '" + layer +
"'");
98 const std::string & wireendKey,
102 AnodeLayer::wireends_t::key_type wireend
104 if (wireend !=
'1' && wireend !=
'2')
105 throw invalid_argument(
"pp" +
toString(ppNbr) +
"::loadSettings()'" + key +
106 "': The loaded value of '" + wireendKey +
107 "' '" + wireend +
"' does not exist. Can only be '1' or '2'");
131 HelperAcqirisDetectors::instance(
_detector)->loadSettings();
134 "' retrieves the nbr of mcp signals of detector '" +
_detector +
135 "'. Condition is '" +
_condition->name() +
"'");
142 TofDetector &det(dynamic_cast<TofDetector&>(rawdet));
172 HelperAcqirisDetectors::instance(
_detector)->loadSettings();
175 "' histograms times of the found mcp signals of detector '" +
_detector +
176 "'. Condition is '"+
_condition->name() +
"'");
183 TofDetector &det(dynamic_cast<TofDetector&>(rawdet));
184 SignalProducer::signals_t::const_iterator it (det.
mcp().
output().begin());
185 SignalProducer::signals_t::const_iterator end (det.
mcp().
output().end());
216 HelperAcqirisDetectors::instance(
_detector)->loadSettings();
219 "' histograms the FWHM vs the height of the found mcp signals" +
220 " of detector '" +
_detector +
"'. Condition is '" +
228 TofDetector &det(dynamic_cast<TofDetector&>(rawdet));
229 SignalProducer::signals_t::const_iterator it(det.
mcp().
output().begin());
230 SignalProducer::signals_t::const_iterator end(det.
mcp().
output().end());
232 for (; it != end; ++it)
259 HelperAcqirisDetectors::instance(
_detector)->loadSettings();
262 "' creates a histogram of the deatime between two consecutive " +
264 "'. Condition is '" +
_condition->name() +
"'");
271 TofDetector &det(dynamic_cast<TofDetector&>(rawdet));
274 for (
size_t i(1); i < mcp.size(); ++i)
309 "' outputs the nbr of signals of layer '" +
_layer +
"' wireend '" +
353 "' histograms the FWHM vs the height from the signals of layer '" +
355 "'. Condition is '" +
_condition->name() +
"'");
363 SignalProducer::signals_t::const_iterator it (det.
layers()[
_layer].wireends()[
_signal].output().begin());
364 SignalProducer::signals_t::const_iterator end (det.
layers()[
_layer].wireends()[
_signal].output().end());
366 for (; it != end; ++it)
396 _range = make_pair(s.
value(
"TimeRangeLow",0).toDouble(),
397 s.
value(
"TimeRangeHigh",20000).toDouble());
400 "' calculates the timesum of layer '" +
_layer +
"' of detector '" +
401 _detector +
"'. It will use the first signals that appeared in the" +
415 result.
setValue(one + two - 2.*mcp);
444 _range = make_pair(s.
value(
"TimeRangeLow",0).toDouble(),
445 s.
value(
"TimeRangeHigh",20000).toDouble());
448 "' histograms the timesum vs Positon on layer '" +
_layer +
"' of detector '" +
460 const double timesum (one + two - 2.*mcp);
461 const double position (one - two);
463 result.
histogram(make_pair(position,timesum));
494 _range = make_pair(s.
value(
"TimeRangeLow",0).toDouble(),
495 s.
value(
"TimeRangeHigh",20000).toDouble());
496 _tsrange = make_pair(make_pair(s.
value(
"TimesumFirstLayerLow",20).toDouble(),
497 s.
value(
"TimesumFirstLayerHigh",200).toDouble()),
498 make_pair(s.
value(
"TimesumSecondLayerLow",20).toDouble(),
499 s.
value(
"TimesumSecondLayerHigh",200).toDouble()));
502 "' creates a detector picture of the first Hit on the detector created" +
503 " from Layers '" +
_first +
"' and '" +
_second +
"' of detector '" +
504 _detector +
"'. The signals from wich the frist hit is calculated have to be in the" +
506 "' ns. The Timesum range of the first layer goes from '"+
toString(_tsrange.first.first) +
507 "' to '" +
toString(_tsrange.first.second) +
"'. The Timesum range of the second layer goes from '" +
508 toString(_tsrange.second.first) +
"' to '" +
toString(_tsrange.second.second) +
509 "'. Condition is '" +
_condition->name() +
"'");
522 const double tsf (f1 + f2 - 2.*mcp);
523 const double tss (s1 + s2 - 2.*mcp);
524 const double f (f1-f2);
525 const double s (s1-s2);
526 const bool csf = (
_tsrange.first.first < tsf && tsf <
_tsrange.first.second);
527 const bool css = (
_tsrange.second.first < tss && tss <
_tsrange.second.second);
568 "' outputs the number of reconstructed hits of detector '" +
_detector +
569 "'. Condition is '" +
_condition->name() +
"'");
615 _cond = make_pair(min(s.
value(
"ConditionLow",-50000.).toFloat(),
616 s.
value(
"ConditionHigh",50000.).toFloat()),
617 max(s.
value(
"ConditionLow",-50000.).toFloat(),
618 s.
value(
"ConditionHigh",50000.).toFloat()));
622 "' of the reconstructed detectorhits of detector '" +
_detector +
625 "'. Condition is '" +
_condition->name() +
"'");
633 detectorHits_t::iterator it (det.
hits().begin());
634 detectorHits_t::iterator end (det.
hits().end());
635 for (; it != end; ++it)
667 HelperAcqirisDetectors::instance(
_detector)->loadSettings();
669 "' creates a histogram of the deatime between two consecutive " +
670 "Anode Signals of detctor '" +
_detector +
671 "'. Condition is '" +
_condition->name() +
"'");
681 for (
size_t i(1); i < anode.size(); ++i)
708 HelperAcqirisDetectors::instance(
_detector01)->loadSettings();
709 HelperAcqirisDetectors::instance(
_detector02)->loadSettings();
711 "' create a PIPICO Histogram of detectors '" +
_detector01 +
719 TofDetector &det01(dynamic_cast<TofDetector&>(rawdet01));
722 TofDetector &det02(dynamic_cast<TofDetector&>(rawdet02));
723 SignalProducer::signals_t::const_iterator it01(det01.
mcp().
output().begin());
724 SignalProducer::signals_t::const_iterator end01(det01.
mcp().
output().end());
725 SignalProducer::signals_t::const_iterator end02(det02.
mcp().
output().end());
727 for (; it01 != end01;++it01)
734 for (; it02 != end02; ++it02)
773 particleHits_t::iterator it (particle.hits().begin());
774 particleHits_t::iterator end (particle.hits().end());
817 particleHits_t::iterator it(particle.hits().begin());
818 particleHits_t::iterator end(particle.hits().end());
820 for (; it != end; ++it)
846 +
"' outputs how many particles were found for '" +
_particle +
857 result.
setValue(particle.hits().size());
pp162(const name_t &)
Constructor.
CachedList::item_type result_t
define the results
ACQIRIS::DelaylineDetector::particles_t::key_type _particle
the particle we are working on
pp166(const name_t &)
Constructor.
particles_t & particles()
retrieve the particle container
Event to store all LCLS Data.
virtual void createHistList(result_t::shared_pointer result)
create result list.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
std::vector< signal_t > signals_t
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
pp167(const name_t &)
Constructor for Ratio of the reconstructed Hits vs MCP Hits.
virtual void loadSettings(size_t)
load the histogram settings from file
const name_t name() const
retrieve the name of this processor
virtual void process(const CASSEvent &, result_t &res)
Retrieve the number of Signals and histogram it.
virtual void loadSettings(size_t)
load the histogram settings from file
pp160(const name_t &)
Constructor for Number of Signals.
file contains declaration of the CASSEvent
file contains declaration of classes that extract information of acqiris detectors.
std::tr1::shared_ptr< self_type > shared_pointer
a shared pointer of this class
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector01
The first detector of the cooincdence.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
ACQIRIS::particleHits _property02
the second property of the particle that we want to retrieve
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
Processor::result_t::shared_pointer set2DHist(const Processor::name_t &name)
function to set the 2d histogram properties from the ini file.
pp252(const name_t &)
Constructor for Number of Signals.
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
std::tr1::shared_ptr< HelperAcqirisDetectors > shared_pointer
typedef a shared pointer of this
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
AnodeLayer::wireends_t::key_type loadWireend(CASSSettings &s, const std::string &wireendKey, int ppNbr, const string &key)
load wireend from file
ACQIRIS::DelaylineDetector::anodelayers_t::key_type _first
The first layer of the detector for the position.
virtual void loadSettings(size_t)
load the histogram settings from file
file contains declaration of processors that extract information of acqiris detectors.
virtual void process(const CASSEvent &, result_t &res)
Retrieve the number of Signals and histogram it.
detectorHits_t & hits()
return the detector hits
pp153(const name_t &)
Constructor for Ratio of the reconstructed Hits vs MCP Hits.
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
pp251(const name_t &)
Constructor for Number of Signals.
ACQIRIS::detectorHits _first
The first value of the detector hit.
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
pp165(const name_t &)
Constructor for Ratio of the reconstructed Hits vs MCP Hits.
pp151(const name_t &)
Constructor.
ACQIRIS::DelaylineDetector::particles_t::key_type _particle
the particle we are working on
A Time of Flight Detector.
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
std::string loadParticle(CASSSettings &s, const std::string &detector, int ppNbr, const std::string &key)
load particle for a specific detector
DelaylineDetector::anodelayers_t::key_type loadLayer(CASSSettings &s, const HelperAcqirisDetectors::helperinstancesmap_t::key_type &detector, const std::string &layerKey, int ppNbr, const string &key)
load layer from file
SignalProducer & mcp()
retrieve the mcp
virtual void process(const CASSEvent &, result_t &res)
Retrieve the number of Signals and histogram it.
ACQIRIS::DelaylineDetector::anodelayers_t::key_type _layer
The layer of the detector detector we are there for.
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
static void add(Level level, const std::string &line)
add a string to the log
void setValue(const_reference value)
assign the result container to a value
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
fromStdString(const std::string &str)
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
virtual void loadSettings(size_t)
load the histogram settings from file
virtual void loadSettings(size_t)
load the histogram settings from file
ACQIRIS::DelaylineDetector::anodelayers_t::key_type _second
The second layer of the detector for the position.
virtual void loadSettings(size_t)
load the histogram settings from file
anodelayers_t & layers()
return the layers
base class for processors.
ACQIRIS::particleHits _property
the property of the particle that we want to retrieve
virtual void loadSettings(size_t)
load the histogram settings from file
virtual void loadSettings(size_t)
load the histogram settings from file
virtual void loadSettings(size_t)
load the histogram settings from file
pp163(const name_t &)
Constructor.
particleHits
types of pariticle hits
std::pair< double, double > _range
the range in which the single events are in
virtual void loadSettings(size_t)
load the histogram settings from file
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector02
The second detector of the cooincdence.
ACQIRIS::detectorHits _second
The second value of the detector.
std::pair< std::pair< double, double >, std::pair< double, double > > _tsrange
timesum ranges of the layers
file contains declaration of classes and functions that help other processors to do their job...
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
ACQIRIS::DelaylineDetector::anodelayers_t::key_type _layer
The layer of the detector detector we are there for.
virtual void loadSettings(size_t)
load the histogram settings from file
pp161(const name_t &)
Constructor.
pp220(const name_t &)
Constructor for Number of Signals.
file contains the declaration of the acqiris part of the CASSEvent
file contains global definitions for project cass
std::pair< double, double > _range
the range in which the single events are in
pp164(const name_t &)
Constructor.
std::string toString(const Type &t)
convert any type to a string
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
pp152(const name_t &)
Constructor for Number of Signals.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
ACQIRIS::AnodeLayer::wireends_t::key_type _signal
The Signal of the layer detector we are there for.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
std::string loadDelayDet(CASSSettings &s, int ppNbr, const std::string &key)
load detector from file
value(const QString &key, const QVariant &defaultValue=QVariant()
ACQIRIS::AnodeLayer::wireends_t::key_type _signal
The Signal of the layer detector we are there for.
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
ACQIRIS::detectorHits _third
The third value of the detector, that we will check the condition for.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
double firstGood(const std::pair< double, double > &range)
returns the time of the first peak in the time range
void setupGeneral()
general setup of the processor
virtual void loadSettings(size_t)
load the histogram settings from file
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
virtual void loadSettings(size_t)
load the histogram settings from file
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
file contains specialized class that do the settings for cass
std::pair< double, double > _range
the range in which the single events are in
signals_t & output()
return the signals
virtual void loadSettings(size_t)
load the histogram settings from file
iterator histogram(const value_t &pos, const value_t &weight=1)
add the weight at the right bin for the value in the 1d array
std::pair< float, float > _cond
The condition that we impose on the third component.
ACQIRIS::DelaylineDetector::anodelayers_t::key_type _layer
The layer of the detector detector we are there for.
virtual void process(const CASSEvent &, result_t &)
Retrieve the number of Signals and histogram it.
Base class for all Detectors attached to an Acqiris Instrument.
ACQIRIS::HelperAcqirisDetectors::helperinstancesmap_t::key_type _detector
The detector we are there for.
static shared_pointer instance(const helperinstancesmap_t::key_type &detector)
static function creating instance of this.
shared_pointer _condition
pointer to the processor that will contain the condition
Processor::result_t::shared_pointer set1DHist(const Processor::name_t &name)
function to set the 1d histogram properties from the ini file.
pp150(const name_t &)
Constructor.
pp250(const name_t &)
Constructor for Number of Signals.
bool setupCondition(bool defaultConditionType=true)
setup the condition.
detectorHits
types of detector hits
std::string name_t
define the name type
contains a logger for cass
virtual void loadSettings(size_t)
load the histogram settings from file
ACQIRIS::particleHits _property01
the first property of the particle that we want to retrieve
ACQIRIS::DelaylineDetector::anodelayers_t::key_type _layer
The layer of the detector detector we are there for.
ACQIRIS::DelaylineDetector::particles_t::key_type _particle
the particle we are working on
beginGroup(const QString &prefix)
ACQIRIS::AnodeLayer::wireends_t::key_type _signal
The Signal of the layer detector we are there for.
virtual void loadSettings(size_t)
load the histogram settings from file
ACQIRIS::DelaylineDetector::anodelayers_t::key_type _layer
The layer of the detector detector we are there for.