ATLAS Offline Software
Loading...
Searching...
No Matches
testRead.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: testRead.cxx 770805 2016-08-30 14:03:33Z ssnyder $
11
12// STL includes:
13#include <iostream>
14#include <limits>
15
16// Root includes:
17#include <TFile.h>
18#include <THashList.h>
19
20// Gaudi includes:
21#if !defined(RINGER_STANDALONE) && !defined(XAOD_STANDALONE)
22# include "GaudiKernel/SystemOfUnits.h"
23using namespace Gaudi::Units;
24// We just do this ugly thing so that we can have a message stream
25// FIXME How can I create a dummy message stream?
26#define protected public
27#define private public
28# include "RingerSelectorTools/AsgElectronRingerSelector.h"
29#undef protected
30#undef private
31Ringer::AsgElectronRingerSelector __AsgRingerSel__("testRead");
32MsgStream &msg = __AsgRingerSel__.msg();
33#else
34#include "RingerSelectorTools/AsgElectronRingerSelector.h"
36MsgStream msg("testRead");
37#endif
38
39#define BREAKER \
40 "================================================================================"
41
42// Local includes:
45#include "RingerSelectorTools/procedures/NeuralNetwork.h"
46#include "RingerSelectorTools/procedures/Thresholds.h"
47#include "RingerSelectorTools/tools/IOHelperFcns.h"
48#include "RingerSelectorTools/tools/cxx/remove_pointer.h"
49
50using namespace Ringer;
51
55template< class wrapper_t >
56void readWrapperFromFile(wrapper_t *&wrapper, const char* fileName);
57
62template<typename wrapperBase_t>
63void readCollectionFromFile(const char* fileName);
64
65template<>
66void readCollectionFromFile<IThresWrapper>(const char* fileName);
67
68int main1(){
69
70 // Change message level and greet user
71 msg.setLevel(MSG::DEBUG);
72
73 msg << MSG::INFO << BREAKER << endmsg;
74 msg << MSG::INFO << "Reading discriminator using interface "
75 "without using normalization." << endmsg;
76 msg << MSG::INFO << BREAKER << endmsg;
77
78 // ----------------------------------------------------------------------------
79 // Read simple discriminator using interface (without using normalization)
80 // ----------------------------------------------------------------------------
81 // Read "basicWrapperWrong" using correct template
85 NoSegmentation > *basicWrapper(nullptr);
87 typename Ringer::remove_pointer<decltype(basicWrapper)>::type
88 >( basicWrapper, "basicWrapper.root" );
89 msg << MSG::INFO << BREAKER << endmsg;
90
91 // Read as "basicEtaDepWrapper" using correct template
95 NoSegmentation > *basicEtaDepWrapper(nullptr);
97 typename Ringer::remove_pointer<decltype(basicEtaDepWrapper)>::type
98 >( basicEtaDepWrapper, "basicEtaDepWrapper.root");
99 msg << MSG::INFO << BREAKER << endmsg;
100
101 // Read "basicEtDepWrapper" using correct template
105 NoSegmentation > *basicEtDepWrapper(nullptr);
107 typename Ringer::remove_pointer<decltype(basicEtDepWrapper)>::type
108 >( basicEtDepWrapper, "basicEtDepWrapper.root");
109 msg << MSG::INFO << BREAKER << endmsg;
110
111 // Read "basicEtaEtDepWrapper.root" using correct template
115 NoSegmentation > *basicEtaEtDepWrapper(nullptr);
117 typename Ringer::remove_pointer<decltype(basicEtaEtDepWrapper)>::type
118 >( basicEtaEtDepWrapper, "basicEtaEtDepWrapper.root");
119 // -------------------------- END --- END --- END -----------------------------
120
121 msg.setLevel(MSG::ERROR);
122
123 msg << MSG::INFO << BREAKER << endmsg;
124 msg << MSG::INFO << "Reading discriminator with wrong types!" << endmsg;
125 msg << MSG::INFO << BREAKER << endmsg;
126 // ----------------------------------------------------------------------------
127 // Read simple discriminator using interface with WRONG types
128 // ----------------------------------------------------------------------------
132 NoSegmentation > *basicWrapperWrong(nullptr);
134 typename Ringer::remove_pointer<decltype(basicWrapperWrong)>::type
135 >( basicWrapperWrong, "basicWrapper.root" );
136 msg << MSG::INFO << BREAKER << endmsg;
137
138 // Read as "basicEtaDepWrapperWrong" using wrong template
142 NoSegmentation > *basicEtaDepWrapperWrong(nullptr);
144 typename Ringer::remove_pointer<decltype(basicEtaDepWrapperWrong)>::type
145 >( basicEtaDepWrapperWrong, "basicEtaDepWrapper.root");
146 msg << MSG::INFO << BREAKER << endmsg;
147
148 // Read "basicEtDepWrapperWrong" using wrong template
152 NoSegmentation > *basicEtDepWrapperWrong(nullptr);
154 typename Ringer::remove_pointer<decltype(basicEtDepWrapperWrong)>::type
155 >( basicEtDepWrapperWrong, "basicEtDepWrapper.root");
156 msg << MSG::INFO << BREAKER << endmsg;
157
158 // Read "basicEtaEtDepWrapperWrong.root" using wrong template
162 TrackCalJointLayers > *basicEtaEtDepWrapperWrong(nullptr);
164 typename Ringer::remove_pointer<decltype(basicEtaEtDepWrapperWrong)>::type
165 >( basicEtaEtDepWrapperWrong, "basicEtaEtDepWrapper.root");
166 // -------------------------- END --- END --- END -----------------------------
167 msg.setLevel(MSG::DEBUG);
168
169 msg << MSG::INFO << BREAKER << endmsg;
170 msg << MSG::INFO << "Reading pre-processings!" << endmsg;
171 msg << MSG::INFO << BREAKER << endmsg;
172 // ----------------------------------------------------------------------------
173 // Start testing pre-processings
174 // ----------------------------------------------------------------------------
175 // Read "basicPPWrapper.root"
179 NoSegmentation > *basicPPWrapper(nullptr);
181 typename Ringer::remove_pointer<decltype(basicPPWrapper)>::type
182 >( basicPPWrapper, "basicPPWrapper.root");
183 msg << MSG::INFO << BREAKER << endmsg;
184
185 // Read "basicEtaDepPPWrapper.root"
189 NoSegmentation > *basicEtaDepPPWrapper(nullptr);
191 typename Ringer::remove_pointer<decltype(basicEtaDepPPWrapper)>::type
192 >( basicEtaDepPPWrapper, "basicEtaDepPPWrapper.root");
193 msg << MSG::INFO << BREAKER << endmsg;
194
195 // Read "basicEtDepPPWrapper.root"
199 NoSegmentation > *basicEtDepPPWrapper(nullptr);
201 typename Ringer::remove_pointer<decltype(basicEtDepPPWrapper)>::type
202 >( basicEtDepPPWrapper, "basicEtDepPPWrapper.root");
203 msg << MSG::INFO << BREAKER << endmsg;
204
205 // Read "basicEtEtaDepPPWrapper.root"
209 NoSegmentation > *basicEtEtaDepPPWrapper(nullptr);
211 typename Ringer::remove_pointer<decltype(basicEtEtaDepPPWrapper)>::type
212 >( basicEtEtaDepPPWrapper, "basicEtEtaDepPPWrapper.root");
213 msg << MSG::INFO << BREAKER << endmsg;
214
215 // Read "basicEtEtaTrackCalDepPPWrapper.root"
219 TrackCalSegmentation > *basicEtEtaTrackCalDepPPWrapper(nullptr);
221 typename Ringer::remove_pointer<decltype(basicEtEtaTrackCalDepPPWrapper)>::type
222 >( basicEtEtaTrackCalDepPPWrapper, "basicEtEtaTrackCalDepPPWrapper.root");
223 msg << MSG::INFO << BREAKER << endmsg;
224
225 // Read "basicEtEtaTrackCalPatTypeDepPPWrapper.root"
229 TrackCalPatTypeSegmentation > *basicEtEtaTrackCalPatTypeDepPPWrapper(nullptr);
231 typename Ringer::remove_pointer<decltype(basicEtEtaTrackCalPatTypeDepPPWrapper)>::type
232 >( basicEtEtaTrackCalPatTypeDepPPWrapper, "basicEtEtaTrackCalPatTypeDepPPWrapper.root");
233 msg << MSG::INFO << BREAKER << endmsg;
234
235 // Read "basicEtaEtSectionDepPPWrapper.root"
239 TrackCalJointSections > *basicEtaEtSectionDepPPWrapper(nullptr);
241 typename Ringer::remove_pointer<decltype(basicEtaEtSectionDepPPWrapper)>::type
242 >( basicEtaEtSectionDepPPWrapper, "basicEtaEtSectionDepPPWrapper.root");
243 msg << MSG::INFO << BREAKER << endmsg;
244
245 // Read "basicEtaEtLayerDepPPWrapper.root"
249 TrackCalJointLayers > *basicEtaEtLayerDepPPWrapper(nullptr);
251 typename Ringer::remove_pointer<decltype(basicEtaEtLayerDepPPWrapper)>::type
252 >( basicEtaEtLayerDepPPWrapper, "basicEtaEtLayerDepPPWrapper.root");
253 msg << MSG::INFO << BREAKER << endmsg;
254
255 // Read "basicNorm1Wrapper.root"
259 NoSegmentation > *basicNorm1Wrapper(nullptr);
261 typename Ringer::remove_pointer<decltype(basicNorm1Wrapper)>::type
262 >( basicNorm1Wrapper, "basicNorm1Wrapper.root");
263 msg << MSG::INFO << BREAKER << endmsg;
264
265 // Read "basicNorm1Wrapper.root"
269 TrackCalJointLayers > *basicLayerDepNorm1Wrapper(nullptr);
271 typename Ringer::remove_pointer<decltype(basicLayerDepNorm1Wrapper)>::type
272 >( basicLayerDepNorm1Wrapper, "basicLayerDepNorm1Wrapper.root");
273 msg << MSG::INFO << BREAKER << endmsg;
274
275 // Read "basicNorm2Wrapper.root"
279 TrackCalJointLayers > *basicNorm2Wrapper(nullptr);
281 typename Ringer::remove_pointer<decltype(basicNorm2Wrapper)>::type
282 >( basicNorm2Wrapper, "basicNorm2Wrapper.root");
283 msg << MSG::INFO << BREAKER << endmsg;
284
285 // Read "basicSqrtWrapper.root"
289 NoSegmentation > *basicSqrtWrapper(nullptr);
291 typename Ringer::remove_pointer<decltype(basicSqrtWrapper)>::type
292 >( basicSqrtWrapper, "basicSqrtWrapper.root");
293 msg << MSG::INFO << BREAKER << endmsg;
294
295 // Read "basicConstantValueWrapper.root"
299 NoSegmentation > *basicConstantValueWrapper(nullptr);
301 typename Ringer::remove_pointer<decltype(basicConstantValueWrapper)>::type
302 >( basicConstantValueWrapper, "basicConstantValueWrapper.root");
303 msg << MSG::INFO << BREAKER << endmsg;
304
305 // Read "basicMevToGevWrapper.root"
309 NoSegmentation > *basicMevToGevWrapper(nullptr);
311 typename Ringer::remove_pointer<decltype(basicMevToGevWrapper)>::type
312 >( basicMevToGevWrapper, "basicMevToGevWrapper.root");
313 msg << MSG::INFO << BREAKER << endmsg;
314
315 // Read "basicSequentialWrapper.root"
319 NoSegmentation > *basicSequentialWrapper(nullptr);
321 typename Ringer::remove_pointer<decltype(basicSequentialWrapper)>::type
322 >( basicSequentialWrapper, "basicSequentialWrapper.root");
323 msg << MSG::INFO << BREAKER << endmsg;
324
325 // Read "basicSpherizationWrapper.root"
329 NoSegmentation > *basicSpherizationWrapper(nullptr);
331 typename Ringer::remove_pointer<decltype(basicSpherizationWrapper)>::type
332 >( basicSpherizationWrapper, "basicSpherizationWrapper.root");
333 msg << MSG::INFO << BREAKER << endmsg;
334
335 // Read "basicMinMaxWrapper.root"
339 NoSegmentation > *basicMinMaxWrapper(nullptr);
341 typename Ringer::remove_pointer<decltype(basicMinMaxWrapper)>::type
342 >( basicMinMaxWrapper, "basicMinMaxWrapper.root");
343 msg << MSG::INFO << BREAKER << endmsg;
344 // -------------------------- END --- END --- END -----------------------------
345
346 msg << MSG::INFO << BREAKER << endmsg;
347 msg << MSG::INFO << "Reading discriminators with pre-processings!" << endmsg;
348 msg << MSG::INFO << BREAKER << endmsg;
349
350 // ----------------------------------------------------------------------------
351 // Read discriminators with pre-processings
352 // ----------------------------------------------------------------------------
353 // Read "randomNorm1PPDiscrWrapper.root"
357 NoSegmentation > *randomNorm1PPDiscrWrapper(nullptr);
359 typename Ringer::remove_pointer<decltype(randomNorm1PPDiscrWrapper)>::type
360 >( randomNorm1PPDiscrWrapper, "randomNorm1PPDiscrWrapper.root");
361 msg << MSG::INFO << BREAKER << endmsg;
362
363 // Read "randomNorm1PPDiscrWrapper.root"
367 NoSegmentation > *randomDepPPrandomDepPPDiscrWrapper(nullptr);
369 typename Ringer::remove_pointer<decltype(randomDepPPrandomDepPPDiscrWrapper)>::type
370 >( randomDepPPrandomDepPPDiscrWrapper, "randomDepPPrandomDepPPDiscrWrapper.root");
371 msg << MSG::INFO << BREAKER << endmsg;
372 // ----------------------------------------------------------------------------
373
374 msg << MSG::INFO << BREAKER << endmsg;
375 msg << MSG::INFO << "Reading segmented discriminator PP wrappers:" << endmsg;
376 msg << MSG::INFO << BREAKER << endmsg;
377
378 // ----------------------------------------------------------------------------
379 // Read segmented discriminators with pre-processings
380 // ----------------------------------------------------------------------------
381 // Read "randomDepPPrandomDepPPDiscrSegmentedWrapper.root"
385 TrackCalJointLayers > *randomDepPPrandomDepPPDiscrSegmentedWrapper(nullptr);
387 typename Ringer::remove_pointer<decltype(randomDepPPrandomDepPPDiscrSegmentedWrapper)>::type
388 >( randomDepPPrandomDepPPDiscrSegmentedWrapper, "randomDepPPrandomDepPPDiscrSegmentedWrapper.root");
389 // -------------------------- END --- END --- END -----------------------------
390
391 msg << MSG::INFO << BREAKER << endmsg;
392 msg << MSG::INFO << "Reading specialized discriminator:" << endmsg;
393 msg << MSG::INFO << BREAKER << endmsg;
394
395 // ----------------------------------------------------------------------------
396 // Read specialized discriminator wrapper with no pre-processings
397 // ----------------------------------------------------------------------------
398 // Read "NNWrapper.root"
399 RingerProcedureWrapper<Discrimination::NNFeedForwardVarDep,
402 NoSegmentation > *NNWrapper(nullptr);
404 typename Ringer::remove_pointer<decltype(NNWrapper)>::type
405 >( NNWrapper, "NNWrapper.root");
406 msg << MSG::INFO << BREAKER << endmsg;
407
408 // Read "NNWrapper.root"
409 RingerProcedureWrapper<Discrimination::NNFeedForwardVarDep,
412 TrackCalJointLayers > *FullDepNNWrapper(nullptr);
414 typename Ringer::remove_pointer<decltype(FullDepNNWrapper)>::type
415 >( FullDepNNWrapper, "FullDepNNWrapper.root");
416 // -------------------------- END --- END --- END -----------------------------
417
418 msg << MSG::INFO << BREAKER << endmsg;
419 msg << MSG::INFO << "Reading specialized discriminator with PP wrappers:" << endmsg;
420 msg << MSG::INFO << BREAKER << endmsg;
421
422 // ----------------------------------------------------------------------------
423 // Read specialized discriminator wrapper with specialized pre-processings
424 // ----------------------------------------------------------------------------
425 // Read "Norm1NNWrapper.root"
426 RingerProcedureWrapper<Discrimination::NNFeedForwardVarDep,
429 NoSegmentation > *Norm1NNWrapper(nullptr);
431 typename Ringer::remove_pointer<decltype(Norm1NNWrapper)>::type
432 >( Norm1NNWrapper, "Norm1NNWrapper.root");
433 msg << MSG::INFO << BREAKER << endmsg;
434
435 // Read "Norm1Norm1FullDepNNWrapper.root"
436 RingerProcedureWrapper<Discrimination::NNFeedForwardVarDep,
439 TrackCalJointLayers > *Norm1Norm1FullDepNNWrapper(nullptr);
441 typename Ringer::remove_pointer<decltype(Norm1Norm1FullDepNNWrapper)>::type
442 >( Norm1Norm1FullDepNNWrapper, "Norm1Norm1FullDepNNWrapper.root");
443 // -------------------------- END --- END --- END -----------------------------
444
445 msg << MSG::INFO << BREAKER << endmsg;
446 msg << MSG::INFO << "Reading threshold wrappers:" << endmsg;
447 msg << MSG::INFO << BREAKER << endmsg;
448
449 // ----------------------------------------------------------------------------
450 // Read thresholds
451 // ----------------------------------------------------------------------------
452 // Read "basicThres.root"
455 EtIndependent > *basicThres(nullptr);
457 typename Ringer::remove_pointer<decltype(basicThres)>::type
458 >( basicThres, "basicThres.root");
459 msg << MSG::INFO << BREAKER << endmsg;
460
461 // Read "basicEtaDepThres.root"
464 EtIndependent > *basicEtaDepThres(nullptr);
466 typename Ringer::remove_pointer<decltype(basicEtaDepThres)>::type
467 >( basicEtaDepThres, "basicEtaDepThres.root");
468 msg << MSG::INFO << BREAKER << endmsg;
469
470 // Read "basicEtDepThres.root"
473 EtDependent > *basicEtDepThres(nullptr);
475 typename Ringer::remove_pointer<decltype(basicEtDepThres)>::type
476 >( basicEtDepThres, "basicEtDepThres.root");
477 msg << MSG::INFO << BREAKER << endmsg;
478
479 // Read "basicEtaEtDepThres.root"
482 EtDependent > *basicEtaEtDepThres(nullptr);
484 typename Ringer::remove_pointer<decltype(basicEtaEtDepThres)>::type
485 >( basicEtaEtDepThres, "basicEtaEtDepThres.root");
486 // -------------------------- END --- END --- END -----------------------------
487
488 msg << MSG::INFO << BREAKER << endmsg;
489 msg << MSG::INFO << "Reading specialized threshold wrappers:" << endmsg;
490 msg << MSG::INFO << BREAKER << endmsg;
491
492 // ----------------------------------------------------------------------------
493 // Read speaclized thresholds
494 // ----------------------------------------------------------------------------
495 // Read "uniqueThres.root"
496 RingerProcedureWrapper<Discrimination::UniqueThresholdVarDep,
498 EtIndependent > *uniqueThres(nullptr);
500 typename Ringer::remove_pointer<decltype(uniqueThres)>::type
501 >( uniqueThres, "uniqueThres.root");
502 msg << MSG::INFO << BREAKER << endmsg;
503
504 // Read "uniqueEtaDepThres.root"
505 RingerProcedureWrapper<Discrimination::UniqueThresholdVarDep,
507 EtIndependent > *uniqueEtaDepThres(nullptr);
509 typename Ringer::remove_pointer<decltype(uniqueEtaDepThres)>::type
510 >( uniqueEtaDepThres, "uniqueEtaDepThres.root");
511 msg << MSG::INFO << BREAKER << endmsg;
512
513 // Read "uniqueEtDepThres.root"
514 RingerProcedureWrapper<Discrimination::UniqueThresholdVarDep,
516 EtDependent > *uniqueEtDepThres(nullptr);
518 typename Ringer::remove_pointer<decltype(uniqueEtDepThres)>::type
519 >( uniqueEtDepThres, "uniqueEtDepThres.root");
520 msg << MSG::INFO << BREAKER << endmsg;
521
522 // Read "uniqueEtaEtDepThres.root"
523 RingerProcedureWrapper<Discrimination::UniqueThresholdVarDep,
525 EtDependent > *uniqueEtaEtDepThres(nullptr);
527 typename Ringer::remove_pointer<decltype(uniqueEtaEtDepThres)>::type
528 >( uniqueEtaEtDepThres, "uniqueEtaEtDepThres.root");
529 // -------------------------- END --- END --- END -----------------------------
530
531
532 msg << MSG::INFO << BREAKER << endmsg;
533 msg << MSG::INFO << "Special reading" << endmsg;
534 msg << MSG::INFO << BREAKER << endmsg;
535
536 // ----------------------------------------------------------------------------
537 // Test reading multiple wrappers
538 // ----------------------------------------------------------------------------
539 readCollectionFromFile<IDiscrWrapper>("Norm1NNWrapper.root");
540 msg << MSG::INFO << BREAKER << endmsg;
541 readCollectionFromFile<IDiscrWrapper>("Norm1Norm1FullDepNNWrapper.root");
542 msg << MSG::INFO << BREAKER << endmsg;
543 readCollectionFromFile<IThresWrapper>("uniqueEtaEtDepThres.root");
544 // -------------------------- END --- END --- END -----------------------------
545
546 msg << MSG::INFO << BREAKER << endmsg;
547 msg << MSG::INFO << "Finished!" << endmsg;
548 msg << MSG::INFO << BREAKER << endmsg;
549
550 return 0;
551}
552
553
554int main()
555{
556 int ret = 1;
557 try {
558 ret = main1();
559 }
560 catch (const std::exception& e) {
561 std::cerr << e.what() << "\n";
562 }
563 return ret;
564}
565
566// =============================================================================
567template< class wrapper_t >
568void readWrapperFromFile(wrapper_t *&wrapper, const char* fileName)
569{
570
571 msg << MSG::INFO << "Reading wrapper: " << wrapper_t::staticFullName()
572 << ", at file named: " << fileName << endmsg;
573
574 // Read file and bring everything to memory:
575 TFile wrapperFile(fileName, "READ");
576 wrapperFile.ReadAll();
577 TDirectory *baseDir = wrapperFile.GetDirectory("");
578
579 std::shared_ptr<THashList> wrapperDirList(nullptr);
580 if ( !( wrapperDirList = IOHelperFcns::getDirList(baseDir) ) ) {
581 throw std::runtime_error(std::string("There are no directories available"));
582 }
583
584 msg << MSG::INFO << "Number(s) of folder(s) within this TFile is "
585 << wrapperDirList->GetSize()
586 << endmsg;
587
588 try {
589
590 TIter iter( wrapperDirList.get() );
591 TDirectory* wrapperDir(nullptr);
592
593 bool foundDir = false;
594
595 while ( (wrapperDir = static_cast<TDirectoryFile*>(iter())) ){
596 if ( wrapperDir->GetName() ==
597 ( std::string(wrapper_t::wrapName) +
598 IOHelperFcns::makeIdxStr(0) ) )
599 {
600 msg << MSG::INFO << "Found directory named "
601 << wrapperDir->GetName() << endmsg;
602 foundDir = true;
603 break;
604 }
605 }
606
607 if ( !foundDir ){
608 throw std::runtime_error(std::string("Couldn't find the wrapper directory"));
609 }
610
611 wrapper = wrapper_t::read(wrapperDir,IOHelperFcns::version());
612
613 if (wrapper == nullptr){
614 throw std::runtime_error(std::string("Returned void pointer."));
615 }
616
617 // Use dummy message stream:
618 wrapper->setMsgStream(&msg);
619
620 msg << MSG::INFO << "Printing wrapper " << endmsg;
621
622 // to print wrapper information:
623 wrapper->print();
624
625 } catch ( const std::runtime_error &e){
626 msg << MSG::ERROR << "Couldn't read due to error: "
627 << e.what() << endmsg;
628 }
629
630 // Close file
631 wrapperFile.Close();
632}
633
634// =============================================================================
635template<typename wrapperBase_t>
636void readCollectionFromFile(const char* fileName)
637{
638
639 msg << MSG::INFO << "Reading file: " << fileName << endmsg;
640
641 // Get wrapper collection and read it:
642 typename wrapperBase_t::WrapperCollection col;
643 wrapperBase_t::read( col, fileName );
644
645 unsigned counter(0);
646 for ( auto *wrapper : col ) {
647 if (wrapper){
648 msg << MSG::INFO << "Printing wrapper " << wrapper->fullName()
649 << " at position " << IOHelperFcns::makeIdxStr(counter++) << endmsg;
650 wrapper->setMsgStream(&msg);wrapper->print();
651 } else {
652 msg << MSG::ERROR << "Couldn't print wrapper on file " << fileName << endmsg;
653 }
654 }
655
656 msg << MSG::INFO << "File configuration: " << endmsg;
657 AsgElectronRingerSelector::IOConfStruct ioConf;
658 AsgElectronRingerSelector::retrieveFileConf( fileName, ioConf );
659 AsgElectronRingerSelector::printConf(ioConf, &msg);
660}
661
662// =============================================================================
663template<>
665{
666
667 msg << MSG::INFO << "Reading file: " << fileName << endmsg;
668
669 // Get wrapper collection and read it:
670 IThresWrapper *wrapper;
671 IThresWrapper::read( wrapper, fileName );
672 if (wrapper) {wrapper->setMsgStream(&msg); wrapper->print();}
673 else msg << MSG::ERROR << "Couldn't print wrapper on file " << fileName << endmsg;
674}
675
676
677
#define endmsg
Discriminator interface to be used by Ringer Wrapper.
Threshold interface to be used by Ringer Wrapper.
PreProcessor interface to be used by Ringer Wrapper.
Use constant value as rings normalization factor.
Normalize data to be bounded within [-1,1] range.
Use norm-2 as rings normalization factor.
Normalize data to have zero mean and unitary standard deviation.
Use SqrtVarDep of norm-1 as rings normalization factor.
Specialization for Discriminator procedure.
Namespace dedicated for Ringer utilities.
MsgStream & msg
Definition testRead.cxx:32
void readWrapperFromFile(wrapper_t *&wrapper, const char *fileName)
Read first wrapper on file with type wrapper_t.
Definition testRead.cxx:568
int main1()
Definition testRead.cxx:68
void readCollectionFromFile(const char *fileName)
Read wrapper collection at file named fileName with base wrapper type wrapperBase_t.
Definition testRead.cxx:636
Ringer::AsgElectronRingerSelector __AsgRingerSel__("testRead")
void readCollectionFromFile< IThresWrapper >(const char *fileName)
Definition testRead.cxx:664
#define BREAKER
Definition testRead.cxx:39
int main()
Definition testRead.cxx:554