5 if ((nsamples<0) || (nsamples>
HO_TP_SAMPLES_MAX)) printf(
"HOTRiggerPrimitiveDigi: nsamples out of range.");
6 if ((whichSampleTriggered<0) || (whichSampleTriggered>nsamples))
7 printf(
"HOTriggerPrimitiveDigi: specified Triggering Sample out of range");
8 if ( (databits>>nsamples) != 0x0000)
9 printf(
"HOTRiggerPrimitiveDigi: Specified extra bits out of nsamples range.");
11 if (samples<0) samples=0;
14 theHO_TP=(
abs(ieta)&0xf) | ((ieta<0)?(0x10):(0x00)) |
16 ((samples&0xF)<<12) | (((whichSampleTriggered)&0xF)<<16) |
17 ((databits&0x3FF)<<20);
22 if ((whichbit<0) || (whichbit>
nsamples())) {
23 printf(
"HOTPDigi: Sample bit requested out of range.");
25 return ((
theHO_TP>>(20+whichbit))&0x0001);
30 s <<
"(HO TP " << HOtpd.
ieta() <<
", " << HOtpd.
iphi() <<
", ";
32 for (
int bit=0; bit<HOtpd.
nsamples(); bit++) {
33 if (HOtpd.
data(bit)) s <<
"1";
static const int HO_TP_SAMPLES_MAX
int iphi() const
get the iphi value
Abs< T >::type abs(const T &t)
bool data(int whichbit=HO_TP_SAMPLES_MAX) const
std::ostream & operator<<(std::ostream &s, const HOTriggerPrimitiveDigi &HOtpd)
int ieta() const
get the signed ieta value
int nsamples() const
get the number of samples used to compute the TP
int whichSampleTriggered() const
get the number of the triggering sample