#include "PhysicsNtuple/Basic.h"#include "PhysicsNtuple/Vertex.h"Go to the source code of this file.
Namespaces | |
| namespace | Anp |
Classes | |
| class | Anp::FillBasic |
Functions | |
| NtpSRStrip * | GetSRStrip (const NtpStRecord &ntpr, int index) |
| void | PrintStrips (const NtpStRecord &record, const int *index_array, int nstrip) |
|
||||||||||||
|
Definition at line 587 of file FillBasic.cxx. References MSG, and NtpStRecord::stp. Referenced by Anp::FillBasic::Get(), and Anp::PrintStrips(). 00588 {
00589 //
00590 // Return pointer to NtpSRStrip with "index"
00591 //
00592 const TClonesArray *strip_array = record.stp;
00593 if(!strip_array)
00594 {
00595 MSG("FillAlg", Msg::kWarning) << "NtpStRecord does not have valid strip array." << endl;
00596 return 0;
00597 }
00598
00599 NtpSRStrip *ntpstp = dynamic_cast<NtpSRStrip *>(strip_array -> At(index));
00600 if(!ntpstp)
00601 {
00602 MSG("FillAlg", Msg::kWarning) << "Could not find NtpSRStrip at " << index << endl;
00603 return 0;
00604 }
00605
00606 return ntpstp;
00607 }
|
|
||||||||||||||||
|
Definition at line 610 of file FillBasic.cxx. References Anp::GetSRStrip(), Lit::Print(), and NtpStRecord::stp. Referenced by TestDataModule::Reco(). 00611 {
00612 if(nstrip < 1 || !index_array)
00613 {
00614 return;
00615 }
00616
00617 const TClonesArray *strip_array = record.stp;
00618 if(!strip_array)
00619 {
00620 cerr << "PrintStrips - NtpStRecord does not have valid strip array." << endl;
00621 return;
00622 }
00623
00624 const int entries = strip_array -> GetEntries();
00625
00626 double raw_east = 0.0, raw_west = 0.0;
00627
00628 cout << "Printing " << nstrip << " strips of NtpSRStrip type" << endl;
00629
00630 for(int i = 0; i < nstrip; ++i)
00631 {
00632 const short index = index_array[i];
00633 if(index < 0 || index >= entries)
00634 {
00635 cerr << "PrintStrips - NtpSRStrip index is out of range: " << index << endl;
00636 continue;
00637 }
00638
00639 NtpSRStrip *ntpstp = Anp::GetSRStrip(record, index);
00640 if(!ntpstp)
00641 {
00642 continue;
00643 }
00644
00645 if(index != ntpstp -> index)
00646 {
00647 cerr << "PrintStrips - mismatched strip and TClonesArray index" << std::endl;
00648 continue;
00649 }
00650
00651 if(ntpstp -> pmtindex0 >= 0 && ntpstp -> ph0.raw > 0.0)
00652 {
00653 raw_east += ntpstp -> ph0.raw;
00654 }
00655 if(ntpstp -> pmtindex1 >= 0 && ntpstp -> ph1.raw > 0.0)
00656 {
00657 raw_west += ntpstp -> ph1.raw;
00658 }
00659
00660 cout << "----------------------------------------------------------------------------" << endl;
00661 cout << "NtpSRStrip #" << i + 1 << " raw (east, west) = ("
00662 << ntpstp -> ph0.raw << ", " << ntpstp -> ph1.raw << ")" << endl;
00663 ntpstp -> Print();
00664 }
00665
00666 cout << "total raw (east, west, total) = (" << raw_east << ", " << raw_west << ", "
00667 << raw_east + raw_west << ")" << endl;
00668 }
|
1.3.9.1