Belle II Software development
VXDTFFilters.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <tracking/dataobjects/FullSecID.h>
12
13#include <tracking/spacePointCreation/SpacePoint.h>
14
15#include <tracking/trackFindingVXD/filterMap/twoHitVariables/Distance1DZ.h>
16#include <tracking/trackFindingVXD/filterMap/twoHitVariables/Distance3DNormed.h>
17#include <tracking/trackFindingVXD/filterMap/twoHitVariables/DistanceInTimeUside.h>
18#include <tracking/trackFindingVXD/filterMap/twoHitVariables/DistanceInTimeVside.h>
19#include <tracking/trackFindingVXD/filterMap/twoHitVariables/SlopeRZ.h>
20#include <tracking/trackFindingVXD/filterMap/twoHitVariables/Distance1DZSquared.h>
21#include <tracking/trackFindingVXD/filterMap/twoHitVariables/Distance2DXYSquared.h>
22#include <tracking/trackFindingVXD/filterMap/twoHitVariables/Distance3DSquared.h>
23
24#include <tracking/trackFindingVXD/filterMap/threeHitVariables/DistanceInTime.h>
25#include <tracking/trackFindingVXD/filterMap/threeHitVariables/Angle3DSimple.h>
26#include <tracking/trackFindingVXD/filterMap/threeHitVariables/CosAngleXY.h>
27#include <tracking/trackFindingVXD/filterMap/threeHitVariables/AngleRZSimple.h>
28#include <tracking/trackFindingVXD/filterMap/threeHitVariables/CircleDist2IP.h>
29#include <tracking/trackFindingVXD/filterMap/threeHitVariables/DeltaSlopeRZ.h>
30#include <tracking/trackFindingVXD/filterMap/threeHitVariables/DeltaSlopeZoverS.h>
31#include <tracking/trackFindingVXD/filterMap/threeHitVariables/DeltaSoverZ.h>
32#include <tracking/trackFindingVXD/filterMap/threeHitVariables/HelixParameterFit.h>
33#include <tracking/trackFindingVXD/filterMap/threeHitVariables/Pt.h>
34#include <tracking/trackFindingVXD/filterMap/threeHitVariables/CircleRadius.h>
35
36#include <tracking/trackFindingVXD/filterMap/filterFramework/Shortcuts.h>
37#include <tracking/trackFindingVXD/filterTools/ObserverPrintResults.h>
38#include <tracking/trackFindingVXD/filterMap/filterFramework/VoidObserver.h> // empty observer
39
40#include <tracking/dataobjects/SectorMapConfig.h>
41
42#include <framework/logging/Logger.h>
43
44#include <vxd/dataobjects/VxdID.h>
45#include <tracking/trackFindingVXD/filterMap/map/CompactSecIDs.h>
46#include <tracking/trackFindingVXD/segmentNetwork/StaticSector.h>
47
48#include <TFile.h>
49#include <TString.h>
50
51namespace Belle2 {
56
62 template<class point_t>
63 class VXDTFFilters final {
64 public:
65
66
68// typedef decltype((0. <= Distance3DSquared<Belle2::SpacePoint>() <= 0.).observe(ObserverPrintResults())) twoHitFilter_t;
69
70
72 typedef decltype(
73 (
74 0. <= DistanceInTimeUside<point_t>() <= 0. &&
75 0. <= DistanceInTimeVside<point_t>() <= 0. &&
76 0. <= Distance3DSquared<point_t>() <= 0.&&
77 0. <= Distance2DXYSquared<point_t>() <= 0.&&
78 0. <= Distance1DZ<point_t>() <= 0.&&
79 0. <= SlopeRZ<point_t>() <= 0.&&
80 0. <= Distance3DNormed<point_t>() <= 0.
81 )
83
84 // March9th2016: TODO: we want to use a big observer observing everything - Working title: MegaObserver.
85// typedef decltype(
86// ((0. <= Distance3DSquared<Belle2::SpacePoint>() <= 0.).observe(VoidObserver())&&
87// (0. <= Distance2DXYSquared<Belle2::SpacePoint>() <= 0.).observe(VoidObserver())&&
88// (0. <= Distance1DZ<Belle2::SpacePoint>() <= 0.).observe(VoidObserver())&&
89// (0. <= SlopeRZ<Belle2::SpacePoint>() <= 0.).observe(VoidObserver())&&
90// (0. <= Distance3DNormed<Belle2::SpacePoint>() <= 0.).observe(VoidObserver())).observe(VoidObserver())
91// ) twoHitFilter_t;
92
94// typedef decltype((0. <= Angle3DSimple<point_t>() <= 0.).observe(Observer3HitPrintResults())) threeHitFilter_t;
95
96
98 typedef decltype(
99 (
100 0. <= DistanceInTime<point_t>() <= 0. &&
101 0. <= Angle3DSimple<point_t>() <= 0.&&
102 0. <= CosAngleXY<point_t>() <= 0.&&
103 0. <= AngleRZSimple<point_t>() <= 0.&&
104 CircleDist2IP<point_t>() <= 0.&&
105 0. <= DeltaSlopeRZ<point_t>() <= 0.&&
106 0. <= DeltaSlopeZoverS<point_t>() <= 0.&&
107 0. <= DeltaSoverZ<point_t>() <= 0.&&
108 0. <= HelixParameterFit<point_t>() <= 0.&&
109 0. <= Pt<point_t>() <= 0.&&
110 0. <= CircleRadius<point_t>() <= 0.
111 )
113
114
118
121 {
122 m_staticSectors.resize(2);
123 // The first static sector is not used and will never be since the first
124 // compact id is 1 and compact id = 0 is reserved to signal an error.
125 m_staticSectors[0] = nullptr;
126 // initialize the first slot of the Static sector vector
127 m_staticSectors[1] = nullptr;
128 }
129
132 {
133 // delete the static sectors
134 for (staticSector_t* aSector : m_staticSectors) if (aSector != nullptr) delete aSector;
135 }
136
142 int addSectorsOnSensor(const std::vector<double>& normalizedUsup,
143 const std::vector<double>& normalizedVsup,
144 const std::vector< std::vector<FullSecID> >& sectorIds)
145 {
146
147 auto addedSectors = m_compactSecIDsMap.addSectors(normalizedUsup,
148 normalizedVsup,
149 sectorIds);
150
151 if ((int) addedSectors != ((int) normalizedVsup.size() + 1) *
152 ((int) normalizedUsup.size() + 1))
153 return addedSectors ;
154
155 addedSectors = 0;
156 try {
157 for (const auto& secIDrow : sectorIds)
158 for (auto secID : secIDrow) {
159 auto compactID = m_compactSecIDsMap.getCompactID(secID);
160
161 if ((int) m_staticSectors.size() <= compactID)
162 m_staticSectors.resize(compactID + 1);
163
164 m_staticSectors[ compactID ] = new staticSector_t(secID) ;
165 m_staticSectors[ compactID ]->assignCompactSecIDsMap(m_compactSecIDsMap);
166
167 addedSectors ++;
168 }
169 } catch (...) { return addedSectors ; }
170
171 return addedSectors;
172 }
173
176 FullSecID inner,
177 const twoHitFilter_t& filter)
178 {
179 if (m_staticSectors.size() <= m_compactSecIDsMap[ outer ] ||
180 m_compactSecIDsMap[ outer ] == 0)
181 return 0;
182
183 m_staticSectors[m_compactSecIDsMap[outer]]->assign2spFilter(inner, filter);
184 return 1;
185 }
186
187
190 FullSecID center,
191 FullSecID inner,
193 {
194
195 if (m_staticSectors.size() <= m_compactSecIDsMap[ outer ] ||
196 m_compactSecIDsMap[ outer ] == 0 ||
197 m_compactSecIDsMap[ center ] == 0 ||
198 m_compactSecIDsMap[ inner ] == 0)
199 return 0;
200
201 m_staticSectors[m_compactSecIDsMap[outer]]->assign3spFilter(center,
202 inner,
203 filter);
204 return 1;
205 }
206
207
211
212
213 // const StaticSectorType& getSector(VxdID aSensorID,
214 // std::pair<float, float> normalizedLocalCoordinates) const
215 // { }
216
220 const staticSector_t* getStaticSector(const FullSecID secID) const
221 {
222 auto sectorPosition = m_compactSecIDsMap[ secID ];
223 if (sectorPosition == 0) return nullptr;
224 return m_staticSectors[ sectorPosition ];
225 }
226
232 const FullSecID& inner) const
233 {
234 // TODO: sanity checks
235 static twoHitFilter_t just_in_case;
236 const auto* staticSector = m_staticSectors[ m_compactSecIDsMap[ outer ] ];
237 // catch case when sector is not part of the sectorMap:
238 if (staticSector == nullptr)
239 return just_in_case;
240 const auto* filterPtr = staticSector->getFilter2sp(inner);
241 if (filterPtr == nullptr)
242 return just_in_case;
243 return *filterPtr;
244 }
245
246
249 double normalizedU, double normalizedV) const
250 {
251 return m_compactSecIDsMap.areCoordinatesValid(aSensorID,
252 normalizedU, normalizedV);
253 }
254
255
257 // JKL: what happens here if no FullSecID could be found?
258 // EP: you get an exception
259 FullSecID getFullID(VxdID aSensorID, double normalizedU, double normalizedV) const
260 {
261 // TODO WARNING how to catch bad cases?
262 return m_compactSecIDsMap.getFullSecID(aSensorID, normalizedU, normalizedV);
263 }
264
269 {
270 return m_staticSectors.at(compactSecID)->getFullSecID();
271 }
272
274 const SectorMapConfig& getConfig(void) const { return m_testConfig; }
278 void setConfig(const SectorMapConfig& config) { m_testConfig = config; }
279
280
283
284
286 const std::vector< staticSector_t*>& getStaticSectors() const { return m_staticSectors; }
287
289 unsigned size() const { return m_compactSecIDsMap.getSize(); }
290
292 bool persistOnRootFile(void) const
293 {
294
295 if (! m_testConfig.Write("config"))
296 return false;
297 // cppcheck-suppress knownConditionTrueFalse ; the persist/retrieve helpers currently always succeed, the check guards future implementations
298 if (! persistSectors())
299 return false;
300
301 // cppcheck-suppress knownConditionTrueFalse ; the persist/retrieve helpers currently always succeed, the check guards future implementations
302 if (! persistFilters())
303 return false;
304
305 return true;
306 };
307
309 bool retrieveFromRootFile(const TString* dirName)
310 {
311 // locked filters cannot be modified
313 B2FATAL("Trying to modify a locked filter! A locked filter is not supposed to be changed anymore!");
314 }
315
316 if (! m_testConfig.Read("config"))
317 return false;
318
319 // cppcheck-suppress knownConditionTrueFalse ; the persist/retrieve helpers currently always succeed, the check guards future implementations
320 if (! retrieveSectors(dirName))
321 return false;
322
323 if (! retrieveFilters(dirName))
324 return false;
325
326 return true;
327 };
328
332 bool setSubLayerIDs(FullSecID sector, int sublayer)
333 {
334 // locked filters cannot be modified
336 B2FATAL("Trying to modify a locked filter! A locked filter is not supposed to be changed anymore!");
337 }
338
339 // first update the static sector
340 // the static sector is retrieved from the compactid which automatically ignores the sublayer id
341 auto sectorPosition = m_compactSecIDsMap[ sector ];
342 if (sectorPosition == 0) return false;
343 staticSector_t* staticsector = m_staticSectors[ sectorPosition ];
344 if (!staticsector) return false;
345 staticsector->setSubLayerID(sublayer);
346
347 // then update the fullsectorid in the compactsectoridmap, the sublayerid of sector will be ignored when searching for sector to update
348 return m_compactSecIDsMap.setSubLayerID(sector, sublayer);
349 }
350
355
359 void modify2SPFilters(const std::vector< std::tuple<int, std::string > >& adjustFunctions)
360 {
361
362 // locked filters cannot be modified
364 B2FATAL("Trying to modify a locked filter! A locked filter is not supposed to be changed anymore!");
365 }
366
367 for (auto staticSector : m_staticSectors) {
368 if (staticSector == nullptr) continue;
369 staticSector->modify2SPFilters(adjustFunctions);
370 }
371 };
372
376 void modify3SPFilters(const std::vector< std::tuple<int, std::string > >& adjustFunctions)
377 {
378
379 // locked filters cannot be modified
381 B2FATAL("Trying to modify a locked filter! A locked filter is not supposed to be changed anymore!");
382 }
383
384 for (auto staticSector : m_staticSectors) {
385 if (staticSector == nullptr) continue;
386 staticSector->modify3SPFilters(adjustFunctions);
387 }
388 };
389
390 private:
391
393 bool persistSectors(void) const
394 {
395 TTree* tree = new TTree(c_CompactSecIDstreeName, c_CompactSecIDstreeName);
396 UInt_t layer, ladder, sensor;
397 tree->Branch("layer", & layer, "layer/i");
398 tree->Branch("ladder", & ladder, "ladder/i");
399 tree->Branch("sensor", & sensor, "sensor/i");
400
401 std::vector< double >* normalizedUsup = new std::vector< double> ();
402 tree->Branch("normalizedUsup", & normalizedUsup);
403
404 std::vector< double >* normalizedVsup = new std::vector< double> ({1., 2., 3., 4.});
405 tree->Branch("normalizedVsup", & normalizedVsup);
406
407 std::vector< std::vector< unsigned int > >* fullSecIDs =
408 new std::vector< std::vector< unsigned int > > ();
409 tree->Branch("fullSecID", & fullSecIDs);
410
411 unsigned nOfLayers = m_compactSecIDsMap.nOfLayers();
412 for (layer = 0 ; layer < nOfLayers ; layer ++) {
413 unsigned nOfLadders = m_compactSecIDsMap.nOfLadders(layer);
414 for (ladder = 0; ladder < nOfLadders ; ladder ++) {
415 unsigned nOfSensors = m_compactSecIDsMap.nOfSensors(layer, ladder);
416 for (sensor = 0; sensor < nOfSensors ; sensor ++) {
417 normalizedUsup->clear();
418 normalizedVsup->clear();
419 fullSecIDs->clear();
420 auto sectorsOnSensor =
421 m_compactSecIDsMap.getSectorsOnSensor(layer, ladder, sensor);
422 sectorsOnSensor.get(normalizedUsup, normalizedVsup, fullSecIDs);
423 tree->Fill();
424 }
425 }
426 }
427 delete normalizedVsup;
428 delete normalizedUsup;
429 delete fullSecIDs;
430 return true;
431 }
432
434 bool retrieveSectors(const TString* dirName)
435 {
436 TString treeName = *dirName;
437 treeName.Append("/");
438 treeName.Append(c_CompactSecIDstreeName);
439 TTree* tree = dynamic_cast<TTree*>(gFile->Get(treeName));
440 UInt_t layer, ladder, sensor;
441 if (tree->SetBranchAddress("layer", & layer) < 0) B2FATAL("VXDTFFilters: invalid branch address");
442 if (tree->SetBranchAddress("ladder", & ladder) < 0) B2FATAL("VXDTFFilters: invalid branch address");
443 if (tree->SetBranchAddress("sensor", & sensor) < 0) B2FATAL("VXDTFFilters: invalid branch address");
444
445 std::vector< double >* normalizedUsup = new std::vector< double> ();
446 if (tree->SetBranchAddress("normalizedUsup", & normalizedUsup) < 0) B2FATAL("VXDTFFilters: invalid branch address");
447
448 std::vector< double >* normalizedVsup = new std::vector< double> ({1., 2., 3., 4.});
449 if (tree->SetBranchAddress("normalizedVsup", & normalizedVsup) < 0) B2FATAL("VXDTFFilters: invalid branch address");
450
451 std::vector< std::vector< unsigned int > >* fullSecIDs =
452 new std::vector< std::vector< unsigned int > > ();
453 if (tree->SetBranchAddress("fullSecID", & fullSecIDs) < 0) B2FATAL("VXDTFFilters: invalid branch address");
454
455
456 for (Long64_t i = 0; i < tree->GetEntries() ; i++) {
457 tree->GetEntry(i);
458 this->addSectorsOnSensor(* normalizedUsup,
459 * normalizedVsup,
460 * fullSecIDs);
461 }
462
463 delete normalizedVsup;
464 delete normalizedUsup;
465 delete fullSecIDs;
466 return true;
467 }
468
470 bool persistFilters(void) const
471 {
472
473 TTree* sp2tree = new TTree("SegmentFilters", "SegmentFilters");
474 twoHitFilter_t twoHitFilter;
475 twoHitFilter.persist(sp2tree, "filter");
476
477 unsigned int outerFullSecID2sp, innerFullSecID2sp;
478 sp2tree->Branch("outerFullSecID", & outerFullSecID2sp);
479 sp2tree->Branch("innerFullSecID", & innerFullSecID2sp);
480
481
482 TTree* sp3tree = new TTree("TripletsFilters", "TripletFilters");
483 threeHitFilter_t threeHitFilter;
484 threeHitFilter.persist(sp3tree, "filter");
485
486 unsigned int outerFullSecID3sp, centerFullSecID3sp,
487 innerFullSecID3sp;
488 sp3tree->Branch("outerFullSecID", & outerFullSecID3sp);
489 sp3tree->Branch("centerFullSecID", & centerFullSecID3sp);
490 sp3tree->Branch("innerFullSecID", & innerFullSecID3sp);
491
492 for (const auto* staticSector : m_staticSectors) {
493 if (staticSector == nullptr)
494 // Why there is an empty sector per layer?
495 continue;
496
497
498 outerFullSecID3sp = outerFullSecID2sp = staticSector->getFullSecID();
499 auto segmentFilters = staticSector->getAllFilters2sp();
500 for (auto compactIdFilterPair : segmentFilters) {
501 auto innerCompactId = compactIdFilterPair.first;
502 innerFullSecID2sp = getFullID(innerCompactId);
503 twoHitFilter = compactIdFilterPair.second;
504 sp2tree->Fill();
505 }
506
507 auto tripletFilters = staticSector->getAllFilters3sp();
508 for (auto compactIdFilterPair : tripletFilters) {
509 CompactSecIDs::sectorID_t id_center, id_inner;
510 CompactSecIDs::extractCompactID(compactIdFilterPair.first, id_center, id_inner);
511 centerFullSecID3sp = getFullID(id_center);
512 innerFullSecID3sp = getFullID(id_inner);
513 threeHitFilter = compactIdFilterPair.second;
514 sp3tree->Fill();
515 }
516
517
518 }
519
520 return true;
521 }
522
524 bool retrieveFilters(const TString* dirName)
525 {
526 TString sp2treeName = *dirName;
527 sp2treeName.Append("/SegmentFilters");
528 TTree* sp2tree = dynamic_cast<TTree*>(gFile->Get(sp2treeName));
529 if (!sp2tree)
530 return false;
531
532 twoHitFilter_t twoHitFilter;
533 twoHitFilter.setBranchAddress(sp2tree, "filter");
534
535 unsigned int outerFullSecID2sp, innerFullSecID2sp;
536 if (sp2tree->SetBranchAddress("outerFullSecID", & outerFullSecID2sp) < 0) B2FATAL("VXDTFFilters: invalid branch address");
537 if (sp2tree->SetBranchAddress("innerFullSecID", & innerFullSecID2sp) < 0) B2FATAL("VXDTFFilters: invalid branch address");
538
539 for (Long64_t i = 0 ; i < sp2tree->GetEntries() ; i++) {
540 sp2tree->GetEntry(i);
541
542 // cross check to only put filters into the map which outer sector is also on outer layer!
543 FullSecID outer_secid_2sp(outerFullSecID2sp);
544 FullSecID inner_secid_2sp(innerFullSecID2sp);
545 // equal layer numbers are allowed!
546 if (outer_secid_2sp.getLayerNumber() < inner_secid_2sp.getLayerNumber()) {
547 B2WARNING("Outer sector is not on outer layer! Not adding this filter. \"Outer\" layer number: "
548 << outer_secid_2sp.getLayerNumber() << " \"Inner\" layer number " << inner_secid_2sp.getLayerNumber());
549 continue;
550 }
551
552 // add filter to the map
553 if (!addTwoHitFilter(outer_secid_2sp, inner_secid_2sp,
554 twoHitFilter))
555 return false;
556
557 }
558
559 TString sp3treeName = *dirName;
560 sp3treeName.Append("/TripletsFilters");
561 TTree* sp3tree = dynamic_cast<TTree*>(gFile->Get(sp3treeName));
562 if (! sp3tree)
563 return false;
564 threeHitFilter_t threeHitFilter;
565 threeHitFilter.setBranchAddress(sp3tree, "filter");
566
567 unsigned int outerFullSecID3sp, centerFullSecID3sp,
568 innerFullSecID3sp;
569 if (sp3tree->SetBranchAddress("outerFullSecID", & outerFullSecID3sp) < 0) B2FATAL("VXDTFFilters: invalid branch address");
570 if (sp3tree->SetBranchAddress("centerFullSecID", & centerFullSecID3sp) < 0) B2FATAL("VXDTFFilters: invalid branch address");
571 if (sp3tree->SetBranchAddress("innerFullSecID", & innerFullSecID3sp) < 0) B2FATAL("VXDTFFilters: invalid branch address");
572
573 for (Long64_t i = 0 ; i < sp3tree->GetEntries() ; i++) {
574 sp3tree->GetEntry(i);
575
576 // cross check to only put filters which layers have correct order
577 FullSecID outer_secid_3sp(outerFullSecID3sp);
578 FullSecID center_secid_3sp(centerFullSecID3sp);
579 FullSecID inner_secid_3sp(innerFullSecID3sp);
580 // equal layer numbers are allowed
581 if (outer_secid_3sp.getLayerNumber() < center_secid_3sp.getLayerNumber() or
582 center_secid_3sp.getLayerNumber() < inner_secid_3sp.getLayerNumber()) {
583 B2WARNING("Layers not in the correct order for Triplet filter! Will not add filter! Outer layer number: " <<
584 outer_secid_3sp.getLayerNumber() << " center layer number: " << center_secid_3sp.getLayerNumber() <<
585 " inner layer number: " << inner_secid_3sp.getLayerNumber());
586 continue;
587 }
588
589 // add the filter to the map
590 if (!addThreeHitFilter(outer_secid_3sp, center_secid_3sp,
591 inner_secid_3sp,
592 threeHitFilter))
593 return false;
594
595 }
596
597 return true;
598 }
599
603 int addSectorsOnSensor(const std::vector< double>& normalizedUsup,
604 const std::vector< double>& normalizedVsup,
605 const std::vector< std::vector< unsigned int >>&
606 fullSecIDsBaseType)
607 {
608 std::vector< std::vector< FullSecID >> fullSecIDs;
609
610 for (const auto& col : fullSecIDsBaseType) {
611 std::vector< FullSecID > tmp_col;
612 for (auto id : col)
613 tmp_col.push_back(FullSecID(id));
614 fullSecIDs.push_back(tmp_col);
615 }
616
617 return addSectorsOnSensor(normalizedUsup, normalizedVsup, fullSecIDs);
618 }
619
626
630 std::vector< staticSector_t* > m_staticSectors;
631
635
637 const char* c_CompactSecIDstreeName = "CompactSecIDs";
638
644 };
645
647}
This class provides a computer convenient numbering scheme for the sectors in the sector map and for ...
uint16_t sectorID_t
Typedef of the compact Id for a single sector.
static void extractCompactID(secPairID_t pair_id, sectorID_t &id1, sectorID_t &id2)
Uses the values coded by the Sector Pair ID pair_id and sets the two compact Sector ids id1 and id2.
Class to identify a sector inside of the VXD.
Definition FullSecID.h:33
short int getLayerNumber() const
returns LayerID compatible with basf2 standards.
Definition FullSecID.h:122
void setSubLayerID(int sublayer)
set sublayer ID, needed as it is updated in the trainings phase
FullSecID getFullID(VxdID aSensorID, double normalizedU, double normalizedV) const
returns fullSecID for given sensorID and local coordinates.
const std::vector< staticSector_t * > & getStaticSectors() const
JKL: intended for some checks only - returns CompactIDsMap storing the static sectors.
int addSectorsOnSensor(const std::vector< double > &normalizedUsup, const std::vector< double > &normalizedVsup, const std::vector< std::vector< FullSecID > > &sectorIds)
To add an array of sectors on a sensor.
unsigned size() const
returns number of compact secIDs stored for this filter-container.
bool retrieveSectors(const TString *dirName)
Read the whole CompactSecIDs from the current TDirectory.
bool areCoordinatesValid(VxdID aSensorID, double normalizedU, double normalizedV) const
check if using getFullID() would be safe (true if it is safe):
const twoHitFilter_t getTwoHitFilters(const FullSecID &outer, const FullSecID &inner) const
retrieves a two hit filter:
bool retrieveFromRootFile(const TString *dirName)
Retrieves from the current TDirectory all the VXDTFFilters.
FullSecID getFullID(CompactSecIDs::sectorID_t compactSecID) const
returns the FullSecId of
bool persistSectors(void) const
Persists all the sectors on the current TDirectory.
VXDTFFilters()
Construct the container of all the filters used by the VXD Track Finder.
bool persistOnRootFile(void) const
Persists (i.e.: writes) on the current TDirectory the whole object.
decltype((0.<=DistanceInTimeUside< SpacePoint >()<=0. &&0.<=DistanceInTimeVside< SpacePoint >()<=0. &&0.<=Distance3DSquared< SpacePoint >()<=0.&&0.<=Distance2DXYSquared< SpacePoint >()<=0.&&0.<=Distance1DZ< SpacePoint >()<=0.&&0.<=SlopeRZ< SpacePoint >()<=0.&&0.<=Distance3DNormed< SpacePoint >()<=0.)) twoHitFilter_t
bool setSubLayerIDs(FullSecID sector, int sublayer)
during the trainings phase the sublayer ids have to be updated
CompactSecIDs::sectorID_t getCompactID(FullSecID outer) const
returns compactSecID for given FullSecID, == 0 if not found.
void modify2SPFilters(const std::vector< std::tuple< int, std::string > > &adjustFunctions)
modifies the 2SP-filters according to the functions given
const SectorMapConfig & getConfig(void) const
returns the configuration settings for this VXDTFFilters.
std::vector< staticSector_t * > m_staticSectors
void lockFilters()
This function should be called only AFTER all adjustments to the filters have been performed.
const CompactSecIDs & getCompactIDsMap() const
JKL: intended for some checks only - returns CompactIDsMap storing the static sectors.
bool retrieveFilters(const TString *dirName)
Retrieves from the current TDirectory the StaticSectors.
int addThreeHitFilter(FullSecID outer, FullSecID center, FullSecID inner, const threeHitFilter_t &filter)
adds a three hit filter
void setConfig(const SectorMapConfig &config)
set the configuration which is used to create this filter
int addTwoHitFilter(FullSecID outer, FullSecID inner, const twoHitFilter_t &filter)
adds a two hit filter
decltype((0.<=DistanceInTime< SpacePoint >()<=0. &&0.<=Angle3DSimple< SpacePoint >()<=0.&&0.<=CosAngleXY< SpacePoint >()<=0.&&0.<=AngleRZSimple< SpacePoint >()<=0.&&CircleDist2IP< SpacePoint >()<=0.&&0.<=DeltaSlopeRZ< SpacePoint >()<=0.&&0.<=DeltaSlopeZoverS< SpacePoint >()<=0.&&0.<=DeltaSoverZ< SpacePoint >()<=0.&&0.<=HelixParameterFit< SpacePoint >()<=0.&&0.<=Pt< SpacePoint >()<=0.&&0.<=CircleRadius< SpacePoint >()<=0.)) threeHitFilter_t
int addSectorsOnSensor(const std::vector< double > &normalizedUsup, const std::vector< double > &normalizedVsup, const std::vector< std::vector< unsigned int > > &fullSecIDsBaseType)
Adds the static sector: TODO: need documentation for the parameters.
bool persistFilters(void) const
Persists on the current TDirectory the StaticSectors.
void modify3SPFilters(const std::vector< std::tuple< int, std::string > > &adjustFunctions)
modifies the 3SP-filters according to the functions given
const staticSector_t * getStaticSector(const FullSecID secID) const
returns pointer to static sector for given fullSecID.
~VXDTFFilters()
Destructor.
StaticSector< SpacePoint, twoHitFilter_t, threeHitFilter_t, int > staticSector_t
Class to uniquely identify a any structure of the PXD and SVD.
Definition VxdID.h:32
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double > > &runs, double cut, std::map< ExpRun, std::pair< double, double > > &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition Splitter.cc:38
Abstract base class for different kinds of events.
simple struct containing all the configuration data needed for the SecMapTrainer.