1 #include <det/Detector.h>
2 #include <fdet/FDetector.h>
4 #include <fdet/Telescope.h>
5 #include <fdet/Pixel.h>
6 #include <fevt/Telescope.h>
7 #include <fevt/EyeRecData.h>
8 #include <fevt/Channel.h>
9 #include <fevt/Pixel.h>
10 #include <fevt/TelescopeSimData.h>
11 #include <fevt/TelescopeRecData.h>
12 #include <fevt/TelescopeTriggerData.h>
13 #include <utl/ErrorLogger.h>
14 #include <utl/AugerException.h>
15 #include <utl/IteratorDeprecator.h>
16 #include <utl/PointerContainer.h>
24 Telescope::Telescope(
const unsigned int eyeId,
const unsigned int telescopeId,
28 fRawTelPointing(
"unknown"),
45 if (
this != &telescope) {
57 fChannels.push_back(
new Channel(*cp));
62 for (
const auto pp : telescope.
fPixels)
63 fPixels.push_back(
new Pixel(*pp));
87 for (
auto&
c : ChannelsRange())
88 if (
c.GetId() == channelId)
92 err <<
"Non existent channel requested, Eye: " <<
fEyeId
104 for (
const auto&
c : ChannelsRange())
105 if (
c.GetId() == channelId)
109 err <<
"Non existent channel requested, Eye: " <<
fEyeId
120 for (
const auto&
c : ChannelsRange())
121 if (
c.GetId() == channelId) {
123 err <<
"Channel already exists, Eye: " <<
fEyeId
125 <<
" - Not replacing";
138 for (
const auto&
c : ChannelsRange())
139 if (
c.GetId() == channelId)
150 for (
auto&
p : PixelsRange(status))
151 if (
p.GetId() == pixelId)
155 err <<
"Non existent pixel (status: " << int(status) <<
") requested, Eye: " <<
fEyeId
156 <<
" Tel: " <<
fTelescopeId <<
" pix: " << pixelId <<
".";
161 err <<
" Pixel not defined! ";
173 for (
const auto&
p : PixelsRange(status))
174 if (
p.GetId() == pixelId)
178 err <<
"Non existent pixel (status: " << int(status) <<
") requested, Eye: " <<
fEyeId
179 <<
" Tel: " <<
fTelescopeId <<
" pix: " << pixelId <<
".";
184 err <<
" Pixel not defined! ";
194 for (
const auto&
p : PixelsRange(status))
195 if (
p.GetId() == pixelId) {
197 err <<
"pixel " << pixelId <<
" already exists for eye " <<
fEyeId
211 for (
const auto&
p : PixelsRange(status))
212 if (
p.GetId() == pixelId)
238 ERROR(
"TelescopeSimData already exists - Not Replacing");
263 ERROR(
"TelescopeRecData already exists - Not Replacing");
288 ERROR(
"TelescopeTriggerData already exists - Not Replacing");
298 const fdet::FDetector& fDet = det::Detector::GetInstance().GetFDetector();
302 const double cosNeighbourPixelAngle = cos((4./3*1.05)*dTel.
GetCamera().
GetEta());
305 vector<Vector> candidatePixelDirections;
308 for (
const auto& pv : dTel.OutOfBorderPixelsRange())
309 candidatePixelDirections.push_back(pv);
320 for (
const auto& cd : candidatePixelDirections) {
327 const unsigned int id =
p.GetId();
361 utl::IteratorDeprecator::GetInstance().Deprecated(
"fevt::Telescope::PixelsBegin");
373 utl::IteratorDeprecator::GetInstance().Deprecated(
"fevt::Telescope::PixelsBegin");
384 utl::IteratorDeprecator::GetInstance().Deprecated(
"fevt::Telescope::PixelsEnd");
396 utl::IteratorDeprecator::GetInstance().Deprecated(
"fevt::Telescope::PixelsEnd");
409 fRecData->CorrectIds(eyeId, telescopeId);
410 for (
auto&
c : ChannelsRange())
411 c.CorrectIds(eyeId, telescopeId);
412 for (
auto&
p : AllPixelsRange())
413 p.CorrectIds(eyeId, telescopeId);
Predicate specifying whether telescope is selected or not.
utl::Vector GetCameraPixelDirection(const unsigned int pixelId) const
ComponentSelector::Status GetStatus() const
void GenerateMirrorEventBorderPixels() const
AllPixelIterator AllPixelsEnd()
utl::TimeStamp fTracesStartTime
unsigned int GetFirstPixelId() const
double GetEta() const
Camera angular pixel spacing.
unsigned int GetEyeId() const
Base class for exceptions trying to access non-existing components.
Telescope & operator=(const Telescope &t)
fevt::TelescopeRecData & GetRecData()
Reconstructed data for this telescope.
InternalChannelContainer fChannels
AllPixelIterator AllPixelsBegin()
const Camera & GetCamera() const
Get the Camera object that belongs to the telescope.
PixelIterator PixelsEnd()
iterator pointing to end of available pixels of status eHasData (DEPRECATED)
std::vector< utl::Vector >::const_iterator ConstMirrorEventBorderPixelsIterator
Detector description interface for FDetector-related data.
InternalPixelContainer fPixels
void MakePixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Make Pixel telescopeId.
bool HasPixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData) const
Check if the pixel is in the event.
fevt::TelescopeSimData & GetSimData()
Description of simulated data for one Telescope.
ConstMirrorEventBorderPixelsIterator MirrorEventBorderPixelsEnd() const
End of list of pixels just outside the mirror event.
unsigned int GetLastPixelId() const
Channel & GetChannel(const unsigned int channelId)
InternalPixelDirCollection fMirrorEventBorderPixelsDir
Fluorescence Detector Pixel event.
unsigned int fTelescopeId
void CorrectIds(const unsigned int eyeId, const unsigned int telescopeId)
boost::filter_iterator< ComponentSelector, ConstAllPixelIterator > ConstPixelIterator
Telescope-specific shower reconstruction data.
Fluorescence Detector Channel Event.
utl::ShadowPtr< TelescopeRecData > fRecData
Status
Possible component status.
void MakeChannel(const unsigned int channelId)
fTelescopeId(t.GetTelescopeId())
ConstMirrorEventBorderPixelsIterator MirrorEventBorderPixelsBegin() const
Begin of list of pixels just outside the mirror event.
utl::ShadowPtr< TelescopeTriggerData > fTriggerData
Pixel & GetPixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Pixel by Id, throw exception if not existent.
boost::filter_iterator< ComponentSelector, AllPixelIterator > PixelIterator
selective Pixel iterators
Detector description interface for Telescope-related data.
bool HasChannel(const unsigned int channelId) const
const Telescope & GetTelescope(const fevt::Telescope &eventTel) const
Get fdet::Telescope from fevt::Telescope.
ComponentSelector::Status fStatus
This is for HEAT to determine pointing.
unsigned int GetId() const
utl::ShadowPtr< TelescopeSimData > fSimData
double CosAngle(const Vector &l, const Vector &r)
std::string fRawTelPointing
Fluorescence Detector Telescope Event.
PixelIterator PixelsBegin()
iterator pointing to first available pixel of status eHasData (DEPRECATED)
Description of trigger data for one Telescope.
#define ERROR(message)
Macro for logging error messages.
fevt::TelescopeTriggerData & GetTriggerData()
void Assign(const Telescope &t)
copy all but keep original telescope and eye id