GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Signals.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
23 #ifndef ADF_Signals
24 #define ADF_Signals
25 
26 #include "ADFConfig.h"
27 #include "BufferIO.h"
28 
29 namespace ADF
30 {
31 
33 
39 class Signal
40 {
41 protected:
42  mutable UInt_t fLast;
43 
44 protected:
45  Signal(): fLast(0u)
46  {;}
47 
48 public:
49  virtual ~Signal()
50  {;}
51 
53  static UShort_t UShort(Short_t val)
54  {
55  UShort_t rval;
56  if ( val < 0 )
57  rval = 0u;
58  else
59  rval = UShort_t(val);
60  return rval;
61  }
63  static UShort_t UShort(UShort_t val)
64  {
65  return val;
66  }
68  static UShort_t UShort(Int_t val)
69  {
70  UShort_t rval;
71  if ( val > Int_t(kMaxUShort_t) )
72  rval = kMaxUShort_t;
73  else {
74  if ( val < 0 )
75  rval = 0u;
76  else
77  rval = UShort_t(val);
78  }
79  return rval;
80  }
82  static UShort_t UShort(UInt_t val)
83  {
84  UShort_t rval;
85  if ( val > kMaxUShort_t )
86  rval = kMaxUShort_t;
87  else
88  rval = UShort_t(val);
89  return rval;
90  }
92  static UShort_t UShort(Float_t val)
93  {
94  UShort_t rval;
95  if ( val > kMaxUShort_t )
96  rval = kMaxUShort_t;
97  else {
98  if ( val < 0 )
99  rval = 0u;
100  else
101  rval = UShort_t(val);
102  }
103  return rval;
104  }
106  static UShort_t UShort(Double_t val)
107  {
108  UShort_t rval;
109  if ( val > kMaxUShort_t )
110  rval = kMaxUShort_t;
111  else {
112  if ( val < 0 )
113  rval = 0u;
114  else
115  rval = UShort_t(val);
116  }
117  return rval;
118  }
120  static Short_t Short(Short_t val)
121  {
122  return val;
123  }
125  static Short_t Short(UShort_t val)
126  {
127  Short_t rval;
128  if ( val > kMaxShort_t )
129  rval = kMaxShort_t;
130  else
131  rval = Short_t(val);
132  return rval;
133  }
135  static Short_t Short(Int_t val)
136  {
137  Short_t rval;
138  if ( val > kMaxShort_t )
139  rval = kMaxShort_t;
140  else {
141  if ( val < kMinShort_t )
142  rval = kMinShort_t;
143  else
144  rval = Short_t(val);
145  }
146  return rval;
147  }
149  static Short_t Short(UInt_t val)
150  {
151  Short_t rval;
152  if ( val > UInt_t(kMaxShort_t) )
153  rval = kMaxShort_t;
154  else
155  rval = Short_t(val);
156  return rval;
157  }
159  static Short_t Short(Float_t val)
160  {
161  Short_t rval;
162  if ( val > kMaxShort_t )
163  rval = kMaxShort_t;
164  else {
165  if ( val < kMinShort_t )
166  rval = kMinShort_t;
167  else
168  rval = Short_t(val);
169  }
170  return rval;
171  }
173  static Short_t Short(Double_t val)
174  {
175  Short_t rval;
176  if ( val > kMaxShort_t )
177  rval = kMaxShort_t;
178  else {
179  if ( val < kMinShort_t )
180  rval = kMinShort_t;
181  else
182  rval = Short_t(val);
183  }
184  return rval;
185  }
187  static UInt_t UInt(Short_t val)
188  {
189  UInt_t rval;
190  if ( val < 0 )
191  rval = 0u;
192  else
193  rval = UInt_t(val);
194  return rval;
195  }
197  static UInt_t UInt(UShort_t val)
198  {
199  return UInt_t(val);
200  }
202  static UInt_t UInt(Int_t val)
203  {
204  UInt_t rval;
205  if ( val < 0 )
206  rval = 0u;
207  else
208  rval = UInt_t(val);
209  return rval;
210  }
212  static UInt_t UInt(UInt_t val)
213  {
214  return val;
215  }
217  static UInt_t UInt(Float_t val)
218  {
219  UInt_t rval;
220  if ( val > kMaxUInt_t )
221  rval = kMaxUInt_t;
222  else {
223  if ( val < 0.0 )
224  rval = 0u;
225  else
226  rval = UInt_t(val);
227  }
228  return rval;
229  }
231  static UInt_t UInt(Double_t val)
232  {
233  UInt_t rval;
234  if ( val > kMaxUInt_t )
235  rval = kMaxUInt_t;
236  else {
237  if ( val < 0.0 )
238  rval = 0u;
239  else
240  rval = UInt_t(val);
241  }
242  return rval;
243  }
245  static Int_t Int(Short_t val)
246  {
247  return Int_t(val);
248  }
250  static Int_t Int(UShort_t val)
251  {
252  return Int_t(val);
253  }
255  static Int_t Int(Int_t val)
256  {
257  return val;
258  }
260  static Int_t Int(UInt_t val)
261  {
262  Int_t rval;
263  if ( val > UInt_t(kMaxInt_t) )
264  rval = kMaxInt_t;
265  else {
266  rval = Int_t(val);
267  }
268  return rval;
269  }
271  static Int_t Int(Float_t val)
272  {
273  Int_t rval;
274  if ( val > kMaxInt_t )
275  rval = kMaxInt_t;
276  else {
277  if ( val < kMinInt_t )
278  rval = kMinInt_t;
279  else
280  rval = Int_t(val);
281  }
282  return rval;
283  }
285  static Int_t Int(Double_t val)
286  {
287  Int_t rval;
288  if ( val > kMaxInt_t )
289  rval = kMaxInt_t;
290  else {
291  if ( val < kMinInt_t )
292  rval = kMinInt_t;
293  else
294  rval = Int_t(val);
295  }
296  return rval;
297  }
299  static Float_t Float(Short_t val)
300  {
301  return Float_t(val);
302  }
304  static Float_t Float(UShort_t val)
305  {
306  return Float_t(val);
307  }
309  static Float_t Float(Int_t val)
310  {
311  return Float_t(val);
312  }
314  static Float_t Float(UInt_t val)
315  {
316  return Float_t(val);
317  }
319  static Float_t Float(Float_t val)
320  {
321  return val;
322  }
324  static Float_t Float(Double_t val)
325  {
326  return Float_t(val);
327  }
329  static Double_t Double(Short_t val)
330  {
331  return Double_t(val);
332  }
334  static Double_t Double(UShort_t val)
335  {
336  return Double_t(val);
337  }
339  static Double_t Double(Int_t val)
340  {
341  return Double_t(val);
342  }
344  static Double_t Double(UInt_t val)
345  {
346  return Double_t(val);
347  }
349  static Double_t Double(Float_t val)
350  {
351  return Double_t(val);
352  }
354  static Double_t Double(Double_t val)
355  {
356  return val;
357  }
358 
360  virtual UInt_t GetLength() const = 0;
361  virtual Bool_t Resize(UInt_t, Char_t) = 0;
362 
364 
376  virtual UInt_t GetLast() const
377  { return fLast; }
378 
380  virtual UInt_t SizeOf(const Char_t opt = '_') = 0;
381 
383 
394  static Signal *New(UInt_t length, const char *type = "US");
395 
397 
406  virtual Bool_t SetAddress(Char_t* /*external_sig*/ = 0x0, UInt_t /*length*/ = 0u)
407  { return false;}
408 
410 
415  virtual UShort_t *Address(const UShort_t *)
416  { return 0x0; }
417  virtual Short_t *Address(const Short_t *)
418  { return 0x0; }
419  virtual UInt_t *Address(const UInt_t *)
420  { return 0x0; }
421  virtual Int_t *Address(const Int_t *)
422  { return 0x0; }
423  virtual Float_t *Address(const Float_t *)
424  { return 0x0; }
425  virtual Double_t *Address(const Double_t *)
426  { return 0x0; }
427 
429 
441  virtual UShort_t Get(UShort_t, UInt_t) const = 0;
442  virtual Short_t Get( Short_t, UInt_t) const = 0;
443  virtual UInt_t Get( UInt_t, UInt_t) const = 0;
444  virtual Int_t Get( Int_t, UInt_t) const = 0;
445  virtual Float_t Get( Float_t, UInt_t) const = 0;
446  virtual Double_t Get(Double_t, UInt_t) const = 0;
447 
449 
453  virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart = 0u) const = 0;
454  virtual UInt_t Get( Short_t *sig, UInt_t n, UInt_t istart = 0u) const = 0;
455  virtual UInt_t Get( UInt_t *sig, UInt_t n, UInt_t istart = 0u) const = 0;
456  virtual UInt_t Get( Int_t *sig, UInt_t n, UInt_t istart = 0u) const = 0;
457  virtual UInt_t Get( Float_t *sig, UInt_t n, UInt_t istart = 0u) const = 0;
458  virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart = 0u) const = 0;
459 
461 
463  virtual void Set(UShort_t, UInt_t) = 0;
464  virtual void Set( Short_t, UInt_t) = 0;
465  virtual void Set( UInt_t, UInt_t) = 0;
466  virtual void Set( Int_t, UInt_t) = 0;
467  virtual void Set( Float_t, UInt_t) = 0;
468  virtual void Set(Double_t, UInt_t) = 0;
469 
471 
475  virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart = 0u) = 0;
476  virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart = 0u) = 0;
477  virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart = 0u) = 0;
478  virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart = 0u) = 0;
479  virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart = 0u) = 0;
480  virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart = 0u) = 0;
481 
483  virtual Double_t operator[](UInt_t i) const
484  { Double_t r_val = 0.0; r_val = Get(r_val,i); return r_val; }
485 
487 
490  // virtual void Get(Double_t *, UInt_t) const = 0;
491 
493 
496  // virtual void Set(const Double_t *, UInt_t) = 0;
497 
499 
501  virtual void Reset(UInt_t l = 0u) = 0;
502 
504 
508  virtual UInt_t Export(BufferIO *buf, const Char_t opt = '_') const = 0;
509 
511 
515  virtual UInt_t Import(const BufferIO *buf, const Char_t opt = '_') = 0;
516 };
517 
518 
519 template <typename T>
520 class SignalImp : public Signal
521 {
522  friend class Signal;
523 
524 private:
525  UInt_t fInnerLength; // Real length of the inner signal
526  T *fInnerSignal; // Signal
527 
528 protected:
529  UInt_t fLength;
530  UInt_t fRealLength;
531 
532  T *fSignal; //[fLength] signal
533 
534 protected:
535  SignalImp(UInt_t length):
536  Signal(),
537  fInnerLength(0u),
538  fInnerSignal(0x0),
539  fLength(0u),
540  fRealLength(0u),
541  fSignal(0x0)
542  { Reserve(length); }
543 
544 protected:
546 
550  virtual Bool_t Reserve(UInt_t length, char c = '0')
551  {
552  UInt_t l;
553  ( length == 0u ) ? l = 1u : l = length;
554 
555  // check first if fSignal exists and if the RealSize is enough
556  if ( fSignal ) {
557  if ( fRealLength >= l ) {
558  fLength = l;
559  if ( c == '0' )
561  return true;
562  }
563  }
564 
565  // need to expand ... can be done only if the current signal is the inner one
566  if ( fSignal != fInnerSignal )
567  return false;
568 
569  T *sig = 0x0; sig = BaseBuffer::New(sig,l);
570  if ( sig ) {
571  if ( fInnerSignal )
572  { BaseBuffer::Delete(fInnerSignal); }
573 
574  fInnerSignal = sig;
575  fSignal = sig;
576  fLength = fRealLength = fInnerLength = l;
577 
578  return true;
579  }
580  else return false;
581  }
582 
583 public:
584  virtual ~SignalImp()
585  {
586  SetAddress(); // unlink eventual external address
587  if ( fSignal )
589  }
590 
591  virtual UInt_t GetLength() const
592  { return fLength; }
593 
594  virtual Bool_t Resize(UInt_t length, char c = '0')
595  { return Reserve(length,c); }
596 
597  virtual UInt_t SizeOf(const Char_t opt = '_')
598  {
599  UInt_t size = GetLength()*sizeof(T);
600  if ( opt == 'l')
601  size += sizeof(UInt_t);
602  return size;
603  }
604 
605  virtual void Reset(UInt_t l = 0u)
606  {
607  if ( l == 0u )
609  else Reserve(l);
610  }
611 
612  virtual Bool_t SetAddress(Char_t *external_sig = 0x0, UInt_t length = 0u)
613  {
614  // back to inner signal
615  if ( external_sig == 0x0 || external_sig == (Char_t *)fInnerSignal ) {
616 
617  fSignal = fInnerSignal; fRealLength = fInnerLength;
618 
619  if ( length == 0u )
621  else
622  ( length > fInnerLength ) ? fLength = fInnerLength : fLength = length;
623 
624  return true;
625  }
626 
627  // try to cast first
628  T *c_external_sig =
629  (T*)(external_sig);
630  if ( c_external_sig == 0x0 )
631  return false;
632 
633  // casting ok ... replace fSignal par external
634  fSignal = c_external_sig;
635  fRealLength = fLength = length;
636 
637  return true;
638  }
639 
641 
645  virtual UInt_t Export(BufferIO *buf, const Char_t opt = '_') const
646  {
647  UInt_t off_init = buf->Offset(), needed = fLength*sizeof(T);
648 
649  // write the length of the signal (if needed) and the signal
650  if (opt == 'l')
651  { (*buf) << fLength; needed += sizeof(UInt_t); }
652  buf->Import(fSignal,fLength);
653 
654  // back to original offset if something goes wrong
655  if ( buf->Offset() - off_init != needed )
656  buf->SetOffset(off_init);
657 
658  return buf->Offset() - off_init;
659  }
661 
665  virtual UInt_t Import(const BufferIO *buf, const Char_t opt = '_')
666  {
667  Bool_t ok_length = true;
668  UInt_t off_init = buf->Offset(), needed = fLength*sizeof(T), reallength = fLength;
669 
670  // read the length of the signal (if needed) and the signal
671  if (opt == 'l') {
672 
673  (*buf) >> reallength;
674  needed = reallength*sizeof(T) + sizeof(UInt_t);
675 
676  // Expand if required, otherwise reset because the current length could be
677  // smaller that the allocated one.
678  ok_length = Reserve(reallength,'n');
679  }
680  if ( ok_length )
681  buf->Export(fSignal,reallength);
682 
683  // back to original offset if something goes wrong
684  if ( buf->Offset() - off_init != needed )
685  buf->SetOffset(off_init);
686 
687  return buf->Offset() - off_init;
688  }
689 };
690 
692 
694 class SignalUS : public SignalImp<UShort_t>
695 {
696 public:
697  SignalUS(UInt_t length):
698  SignalImp<UShort_t>::SignalImp(length) {;}
699  virtual ~SignalUS()
700  {;}
701 
702  virtual UShort_t *Address(const UShort_t *)
703  { return fSignal; }
704  virtual Short_t *Address(const Short_t *)
705  { return 0x0; }
706  virtual UInt_t *Address(const UInt_t *)
707  { return 0x0; }
708  virtual Int_t *Address(const Int_t *)
709  { return 0x0; }
710  virtual Float_t *Address(const Float_t *)
711  { return 0x0; }
712  virtual Double_t *Address(const Double_t *)
713  { return 0x0; }
714 
715  virtual UShort_t Get(UShort_t /*val*/, UInt_t i) const
716  {
717  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
718  return fSignal[fLast];
719  }
720  virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart = 0u) const
721  {
722  UInt_t tocopy;
723  // starting point in this signal should be in the range [0,GetLength()[
724  if( istart + 1u > GetLength() )
725  return 0u;
726 
727  // compute last value and number of values to be copied
728  fLast = istart + n;
729  tocopy = n;
730  if ( fLast > GetLength() )
731  { fLast = GetLength(); tocopy = (fLast-istart); }
732 
733  // copy ...
734  UShort_t *shifted_signal =
735  fSignal + istart;
736  for(UInt_t i = 0u; i < tocopy; i++) {
737  sig[i] = shifted_signal[i];
738  }
739  return tocopy;
740  }
741  virtual Short_t Get(Short_t /*val*/, UInt_t i) const
742  {
743  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
744  return Signal::Short(fSignal[fLast]);
745  }
746  virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart = 0u) const
747  {
748  UInt_t tocopy;
749  // starting point in this signal should be in the range [0,GetLength()[
750  if( istart + 1u > GetLength() )
751  return 0u;
752 
753  // compute last value and number of values to be copied
754  fLast = istart + n;
755  tocopy = n;
756  if ( fLast > GetLength() )
757  { fLast = GetLength(); tocopy = (fLast-istart); }
758 
759  // copy ...
760  UShort_t *shifted_signal =
761  fSignal + istart;
762  for(UInt_t i = 0u; i < tocopy; i++) {
763  sig[i] = Signal::Short(shifted_signal[i]);
764  }
765  return tocopy;
766  }
767  virtual UInt_t Get(UInt_t /*val*/, UInt_t i) const
768  {
769  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
770  return Signal::UInt(fSignal[fLast]);
771  }
772  virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart = 0u) const
773  {
774  UInt_t tocopy;
775  // starting point in this signal should be in the range [0,GetLength()[
776  if( istart + 1u > GetLength() )
777  return 0u;
778 
779  // compute last value and number of values to be copied
780  fLast = istart + n;
781  tocopy = n;
782  if ( fLast > GetLength() )
783  { fLast = GetLength(); tocopy = (fLast-istart); }
784 
785  // copy ...
786  UShort_t *shifted_signal =
787  fSignal + istart;
788  for(UInt_t i = 0u; i < tocopy; i++) {
789  sig[i] = Signal::UInt(shifted_signal[i]);
790  }
791  return tocopy;
792  }
793  virtual Int_t Get(Int_t /*val*/, UInt_t i) const
794  {
795  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
796  return Signal::Int(fSignal[fLast]);
797  }
798  virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart = 0u) const
799  {
800  UInt_t tocopy;
801  // starting point in this signal should be in the range [0,GetLength()[
802  if( istart + 1u > GetLength() )
803  return 0u;
804 
805  // compute last value and number of values to be copied
806  fLast = istart + n;
807  tocopy = n;
808  if ( fLast > GetLength() )
809  { fLast = GetLength(); tocopy = (fLast-istart); }
810 
811  // copy ...
812  UShort_t *shifted_signal =
813  fSignal + istart;
814  for(UInt_t i = 0u; i < tocopy; i++) {
815  sig[i] = Signal::Int(shifted_signal[i]);
816  }
817  return tocopy;
818  }
819  virtual Float_t Get(Float_t /*val*/, UInt_t i) const
820  {
821  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
822  return Signal::Float(fSignal[fLast]);
823  }
824  virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart = 0u) const
825  {
826  UInt_t tocopy;
827  // starting point in this signal should be in the range [0,GetLength()[
828  if( istart + 1u > GetLength() )
829  return 0u;
830 
831  // compute last value and number of values to be copied
832  fLast = istart + n;
833  tocopy = n;
834  if ( fLast > GetLength() )
835  { fLast = GetLength(); tocopy = (fLast-istart); }
836 
837  // copy ...
838  UShort_t *shifted_signal =
839  fSignal + istart;
840  for(UInt_t i = 0u; i < tocopy; i++) {
841  sig[i] = Signal::Float(shifted_signal[i]);
842  }
843  return tocopy;
844  }
845  virtual Double_t Get(Double_t /*val*/, UInt_t i) const
846  {
847  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
848  return Signal::Double(fSignal[fLast]);
849  }
850  virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart = 0u) const
851  {
852  UInt_t tocopy;
853  // starting point in this signal should be in the range [0,GetLength()[
854  if( istart + 1u > GetLength() )
855  return 0u;
856 
857  // compute last value and number of values to be copied
858  fLast = istart + n;
859  tocopy = n;
860  if ( fLast > GetLength() )
861  { fLast = GetLength(); tocopy = (fLast-istart); }
862 
863  // copy ...
864  UShort_t *shifted_signal =
865  fSignal + istart;
866  for(UInt_t i = 0u; i < tocopy; i++) {
867  sig[i] = Signal::Double(shifted_signal[i]);
868  }
869  return tocopy;
870  }
871  virtual void Set(UShort_t val, UInt_t i)
872  {
873  ( i < fLength ) ? fLast = i : fLast = fLength - 1u;
874  fSignal[fLast] = Signal::UShort(val);
875  }
876  virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart = 0u)
877  {
878  UInt_t tocopy;
879  // starting point in this signal should be in the range [0,GetLength()[
880  if( istart + 1u > GetLength() )
881  return 0u;
882 
883  // compute last value and number of values to be copied
884  fLast = istart + n;
885  tocopy = n;
886  if ( fLast > GetLength() )
887  { fLast = GetLength(); tocopy = (fLast-istart); }
888 
889  // copy ... memcpy to be tested in this particular case to see if it speed up things
890  UShort_t *shifted_signal =
891  fSignal + istart;
892  for(UInt_t i = 0u; i < tocopy; i++) {
893  shifted_signal[i] = sig[i];
894  }
895  return tocopy;
896  }
897  virtual void Set(Short_t val, UInt_t i)
898  {
899  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
900  fSignal[fLast] = Signal::UShort(val);
901  }
902  virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart = 0u)
903  {
904  UInt_t tocopy;
905  // starting point in this signal should be in the range [0,GetLength()[
906  if( istart + 1u > GetLength() )
907  return 0u;
908 
909  // compute last value and number of values to be copied
910  fLast = istart + n;
911  tocopy = n;
912  if ( fLast > GetLength() )
913  { fLast = GetLength(); tocopy = (fLast-istart); }
914 
915  // copy ... memcpy to be tested in this particular case to see if it speed up things
916  UShort_t *shifted_signal =
917  fSignal + istart;
918  for(UInt_t i = 0u; i < tocopy; i++) {
919  shifted_signal[i] = Signal::UShort(sig[i]);
920  }
921  return tocopy;
922  }
923  virtual void Set(UInt_t val, UInt_t i)
924  {
925  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
926  fSignal[fLast] = Signal::UShort(val);
927  }
928  virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart = 0u)
929  {
930  UInt_t tocopy;
931  // starting point in this signal should be in the range [0,GetLength()[
932  if( istart + 1u > GetLength() )
933  return 0u;
934 
935  // compute last value and number of values to be copied
936  fLast = istart + n;
937  tocopy = n;
938  if ( fLast > GetLength() )
939  { fLast = GetLength(); tocopy = (fLast-istart); }
940 
941  // copy ... memcpy to be tested in this particular case to see if it speed up things
942  UShort_t *shifted_signal =
943  fSignal + istart;
944  for(UInt_t i = 0u; i < tocopy; i++) {
945  shifted_signal[i] = Signal::UShort(sig[i]);
946  }
947  return tocopy;
948  }
949  virtual void Set(Int_t val, UInt_t i)
950  {
951  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
952  fSignal[fLast] = Signal::UShort(val);
953  }
954  virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart = 0u)
955  {
956  UInt_t tocopy;
957  // starting point in this signal should be in the range [0,GetLength()[
958  if( istart + 1u > GetLength() )
959  return 0u;
960 
961  // compute last value and number of values to be copied
962  fLast = istart + n;
963  tocopy = n;
964  if ( fLast > GetLength() )
965  { fLast = GetLength(); tocopy = (fLast-istart); }
966 
967  // copy ... memcpy to be tested in this particular case to see if it speed up things
968  UShort_t *shifted_signal =
969  fSignal + istart;
970  for(UInt_t i = 0u; i < tocopy; i++) {
971  shifted_signal[i] = Signal::UShort(sig[i]);
972  }
973  return tocopy;
974  }
975  virtual void Set(Float_t val, UInt_t i)
976  {
977  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
978  fSignal[fLast] = Signal::UShort(val);
979  }
980  virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart = 0u)
981  {
982  UInt_t tocopy;
983  // starting point in this signal should be in the range [0,GetLength()[
984  if( istart + 1u > GetLength() )
985  return 0u;
986 
987  // compute last value and number of values to be copied
988  fLast = istart + n;
989  tocopy = n;
990  if ( fLast > GetLength() )
991  { fLast = GetLength(); tocopy = (fLast-istart); }
992 
993  // copy ... memcpy to be tested in this particular case to see if it speed up things
994  UShort_t *shifted_signal =
995  fSignal + istart;
996  for(UInt_t i = 0u; i < tocopy; i++) {
997  shifted_signal[i] = Signal::UShort(sig[i]);
998  }
999  return tocopy;
1000  }
1001  virtual void Set(Double_t val, UInt_t i)
1002  {
1003  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1004  fSignal[fLast] = Signal::UShort(val);
1005  }
1006  virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart = 0u)
1007  {
1008  UInt_t tocopy;
1009  // starting point in this signal should be in the range [0,GetLength()[
1010  if( istart + 1u > GetLength() )
1011  return 0u;
1012 
1013  // compute last value and number of values to be copied
1014  fLast = istart + n;
1015  tocopy = n;
1016  if ( fLast > GetLength() )
1017  { fLast = GetLength(); tocopy = (fLast-istart); }
1018 
1019  // copy ... memcpy to be tested in this particular case to see if it speed up things
1020  UShort_t *shifted_signal =
1021  fSignal + istart;
1022  for(UInt_t i = 0u; i < tocopy; i++) {
1023  shifted_signal[i] = Signal::UShort(sig[i]);
1024  }
1025  return tocopy;
1026  }
1027 };
1028 
1029 class SignalS : public SignalImp<Short_t>
1030 {
1031 public:
1032  SignalS(UInt_t length):
1033  SignalImp<Short_t>::SignalImp(length) {;}
1034  virtual ~SignalS()
1035  {;}
1036 
1037  virtual UShort_t *Address(const UShort_t *)
1038  { return 0x0; }
1039  virtual Short_t *Address(const Short_t *)
1040  { return fSignal; }
1041  virtual UInt_t *Address(const UInt_t *)
1042  { return 0x0; }
1043  virtual Int_t *Address(const Int_t *)
1044  { return 0x0; }
1045  virtual Float_t *Address(const Float_t *)
1046  { return 0x0; }
1047  virtual Double_t *Address(const Double_t *)
1048  { return 0x0; }
1049 
1050  virtual UShort_t Get(UShort_t /*val*/, UInt_t i) const
1051  {
1052  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1053  return Signal::UShort(fSignal[fLast]);
1054  }
1055  virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart = 0u) const
1056  {
1057  UInt_t tocopy;
1058  // starting point in this signal should be in the range [0,GetLength()[
1059  if( istart + 1u > GetLength() )
1060  return 0u;
1061 
1062  // compute last value and number of values to be copied
1063  fLast = istart + n;
1064  tocopy = n;
1065  if ( fLast > GetLength() )
1066  { fLast = GetLength(); tocopy = (fLast-istart); }
1067 
1068  // copy ...
1069  Short_t *shifted_signal =
1070  fSignal + istart;
1071  for(UInt_t i = 0u; i < tocopy; i++) {
1072  sig[i] = Signal::UShort(shifted_signal[i]);
1073  }
1074  return tocopy;
1075  }
1076  virtual Short_t Get(Short_t /*val*/, UInt_t i) const
1077  {
1078  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1079  return fSignal[fLast];
1080  }
1081  virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart = 0u) const
1082  {
1083  UInt_t tocopy;
1084  // starting point in this signal should be in the range [0,GetLength()[
1085  if( istart + 1u > GetLength() )
1086  return 0u;
1087 
1088  // compute last value and number of values to be copied
1089  fLast = istart + n;
1090  tocopy = n;
1091  if ( fLast > GetLength() )
1092  { fLast = GetLength(); tocopy = (fLast-istart); }
1093 
1094  // copy ...
1095  Short_t *shifted_signal =
1096  fSignal + istart;
1097  for(UInt_t i = 0u; i < tocopy; i++) {
1098  sig[i] = shifted_signal[i];
1099  }
1100  return tocopy;
1101  }
1102  virtual UInt_t Get(UInt_t /*val*/, UInt_t i) const
1103  {
1104  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1105  return Signal::UInt(fSignal[fLast]);
1106  }
1107  virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart = 0u) const
1108  {
1109  UInt_t tocopy;
1110  // starting point in this signal should be in the range [0,GetLength()[
1111  if( istart + 1u > GetLength() )
1112  return 0u;
1113 
1114  // compute last value and number of values to be copied
1115  fLast = istart + n;
1116  tocopy = n;
1117  if ( fLast > GetLength() )
1118  { fLast = GetLength(); tocopy = (fLast-istart); }
1119 
1120  // copy ...
1121  Short_t *shifted_signal =
1122  fSignal + istart;
1123  for(UInt_t i = 0u; i < tocopy; i++) {
1124  sig[i] = Signal::UInt(shifted_signal[i]);
1125  }
1126  return tocopy;
1127  }
1128  virtual Int_t Get(Int_t /*val*/, UInt_t i) const
1129  {
1130  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1131  return Signal::Int(fSignal[fLast]);
1132  }
1133  virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart = 0u) const
1134  {
1135  UInt_t tocopy;
1136  // starting point in this signal should be in the range [0,GetLength()[
1137  if( istart + 1u > GetLength() )
1138  return 0u;
1139 
1140  // compute last value and number of values to be copied
1141  fLast = istart + n;
1142  tocopy = n;
1143  if ( fLast > GetLength() )
1144  { fLast = GetLength(); tocopy = (fLast-istart); }
1145 
1146  // copy ...
1147  Short_t *shifted_signal =
1148  fSignal + istart;
1149  for(UInt_t i = 0u; i < tocopy; i++) {
1150  sig[i] = Signal::Int(shifted_signal[i]);
1151  }
1152  return tocopy;
1153  }
1154  virtual Float_t Get(Float_t /*val*/, UInt_t i) const
1155  {
1156  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1157  return Signal::Float(fSignal[fLast]);
1158  }
1159  virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart = 0u) const
1160  {
1161  UInt_t tocopy;
1162  // starting point in this signal should be in the range [0,GetLength()[
1163  if( istart + 1u > GetLength() )
1164  return 0u;
1165 
1166  // compute last value and number of values to be copied
1167  fLast = istart + n;
1168  tocopy = n;
1169  if ( fLast > GetLength() )
1170  { fLast = GetLength(); tocopy = (fLast-istart); }
1171 
1172  // copy ...
1173  Short_t *shifted_signal =
1174  fSignal + istart;
1175  for(UInt_t i = 0u; i < tocopy; i++) {
1176  sig[i] = Signal::Float(shifted_signal[i]);
1177  }
1178  return tocopy;
1179  }
1180  virtual Double_t Get(Double_t /*val*/, UInt_t i) const
1181  {
1182  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1183  return Signal::Double(fSignal[fLast]);
1184  }
1185  virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart = 0u) const
1186  {
1187  UInt_t tocopy;
1188  // starting point in this signal should be in the range [0,GetLength()[
1189  if( istart + 1u > GetLength() )
1190  return 0u;
1191 
1192  // compute last value and number of values to be copied
1193  fLast = istart + n;
1194  tocopy = n;
1195  if ( fLast > GetLength() )
1196  { fLast = GetLength(); tocopy = (fLast-istart); }
1197 
1198  // copy ...
1199  Short_t *shifted_signal =
1200  fSignal + istart;
1201  for(UInt_t i = 0u; i < tocopy; i++) {
1202  sig[i] = Signal::Double(shifted_signal[i]);
1203  }
1204  return tocopy;
1205  }
1206  virtual void Set(UShort_t val, UInt_t i)
1207  {
1208  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1209  fSignal[fLast] = Signal::Short(val);
1210  }
1211  virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart = 0u)
1212  {
1213  UInt_t tocopy;
1214  // starting point in this signal should be in the range [0,GetLength()[
1215  if( istart + 1u > GetLength() )
1216  return 0u;
1217 
1218  // compute last value and number of values to be copied
1219  fLast = istart + n;
1220  tocopy = n;
1221  if ( fLast > GetLength() )
1222  { fLast = GetLength(); tocopy = (fLast-istart); }
1223 
1224  // copy ... memcpy to be tested in this particular case to see if it speed up things
1225  Short_t *shifted_signal =
1226  fSignal + istart;
1227  for(UInt_t i = 0u; i < tocopy; i++) {
1228  shifted_signal[i] = Signal::Short(sig[i]);
1229  }
1230  return tocopy;
1231  }
1232  virtual void Set(Short_t val, UInt_t i)
1233  {
1234  ( i < fLength ) ? fLast = i : fLast = fLength - 1u;
1235  fSignal[fLast] = val;
1236  }
1237  virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart = 0u)
1238  {
1239  UInt_t tocopy;
1240  // starting point in this signal should be in the range [0,GetLength()[
1241  if( istart + 1u > GetLength() )
1242  return 0u;
1243 
1244  // compute last value and number of values to be copied
1245  fLast = istart + n;
1246  tocopy = n;
1247  if ( fLast > GetLength() )
1248  { fLast = GetLength(); tocopy = (fLast-istart); }
1249 
1250  // copy ... memcpy to be tested in this particular case to see if it speed up things
1251  Short_t *shifted_signal =
1252  fSignal + istart;
1253  for(UInt_t i = 0u; i < tocopy; i++) {
1254  shifted_signal[i] = Signal::Short(sig[i]);
1255  }
1256  return tocopy;
1257  }
1258  virtual void Set(UInt_t val, UInt_t i)
1259  {
1260  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1261  fSignal[fLast] = Signal::Short(val);
1262  }
1263  virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart = 0u)
1264  {
1265  UInt_t tocopy;
1266  // starting point in this signal should be in the range [0,GetLength()[
1267  if( istart + 1u > GetLength() )
1268  return 0u;
1269 
1270  // compute last value and number of values to be copied
1271  fLast = istart + n;
1272  tocopy = n;
1273  if ( fLast > GetLength() )
1274  { fLast = GetLength(); tocopy = (fLast-istart); }
1275 
1276  // copy ... memcpy to be tested in this particular case to see if it speed up things
1277  Short_t *shifted_signal =
1278  fSignal + istart;
1279  for(UInt_t i = 0u; i < tocopy; i++) {
1280  shifted_signal[i] = Signal::Short(sig[i]);
1281  }
1282  return tocopy;
1283  }
1284  virtual void Set(Int_t val, UInt_t i)
1285  {
1286  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1287  fSignal[fLast] = Signal::Short(val);
1288  }
1289  virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart = 0u)
1290  {
1291  UInt_t tocopy;
1292  // starting point in this signal should be in the range [0,GetLength()[
1293  if( istart + 1u > GetLength() )
1294  return 0u;
1295 
1296  // compute last value and number of values to be copied
1297  fLast = istart + n;
1298  tocopy = n;
1299  if ( fLast > GetLength() )
1300  { fLast = GetLength(); tocopy = (fLast-istart); }
1301 
1302  // copy ... memcpy to be tested in this particular case to see if it speed up things
1303  Short_t *shifted_signal =
1304  fSignal + istart;
1305  for(UInt_t i = 0u; i < tocopy; i++) {
1306  shifted_signal[i] = Signal::Short(sig[i]);
1307  }
1308  return tocopy;
1309  }
1310  virtual void Set(Float_t val, UInt_t i)
1311  {
1312  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1313  fSignal[fLast] = Signal::Short(val);
1314  }
1315  virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart = 0u)
1316  {
1317  UInt_t tocopy;
1318  // starting point in this signal should be in the range [0,GetLength()[
1319  if( istart + 1u > GetLength() )
1320  return 0u;
1321 
1322  // compute last value and number of values to be copied
1323  fLast = istart + n;
1324  tocopy = n;
1325  if ( fLast > GetLength() )
1326  { fLast = GetLength(); tocopy = (fLast-istart); }
1327 
1328  // copy ... memcpy to be tested in this particular case to see if it speed up things
1329  Short_t *shifted_signal =
1330  fSignal + istart;
1331  for(UInt_t i = 0u; i < tocopy; i++) {
1332  shifted_signal[i] = Signal::Short(sig[i]);
1333  }
1334  return tocopy;
1335  }
1336  virtual void Set(Double_t val, UInt_t i)
1337  {
1338  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1339  fSignal[fLast] = Signal::Short(val);
1340  }
1341  virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart = 0u)
1342  {
1343  UInt_t tocopy;
1344  // starting point in this signal should be in the range [0,GetLength()[
1345  if( istart + 1u > GetLength() )
1346  return 0u;
1347 
1348  // compute last value and number of values to be copied
1349  fLast = istart + n;
1350  tocopy = n;
1351  if ( fLast > GetLength() )
1352  { fLast = GetLength(); tocopy = (fLast-istart); }
1353 
1354  // copy ... memcpy to be tested in this particular case to see if it speed up things
1355  Short_t *shifted_signal =
1356  fSignal + istart;
1357  for(UInt_t i = 0u; i < tocopy; i++) {
1358  shifted_signal[i] = Signal::Short(sig[i]);
1359  }
1360  return tocopy;
1361  }
1362 };
1363 
1364 class SignalUI : public SignalImp<UInt_t>
1365 {
1366 public:
1367  SignalUI(UInt_t length):
1368  SignalImp<UInt_t>::SignalImp(length) {;}
1369  virtual ~SignalUI()
1370  {;}
1371 
1372  virtual UShort_t *Address(const UShort_t *)
1373  { return 0x0; }
1374  virtual Short_t *Address(const Short_t *)
1375  { return 0x0; }
1376  virtual UInt_t *Address(const UInt_t *)
1377  { return fSignal; }
1378  virtual Int_t *Address(const Int_t *)
1379  { return 0x0; }
1380  virtual Float_t *Address(const Float_t *)
1381  { return 0x0; }
1382  virtual Double_t *Address(const Double_t *)
1383  { return 0x0; }
1384 
1385  virtual UShort_t Get(UShort_t /*val*/, UInt_t i) const
1386  {
1387  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1388  return Signal::UShort(fSignal[fLast]);
1389  }
1390  virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart = 0u) const
1391  {
1392  UInt_t tocopy;
1393  // starting point in this signal should be in the range [0,GetLength()[
1394  if( istart + 1u > GetLength() )
1395  return 0u;
1396 
1397  // compute last value and number of values to be copied
1398  fLast = istart + n;
1399  tocopy = n;
1400  if ( fLast > GetLength() )
1401  { fLast = GetLength(); tocopy = (fLast-istart); }
1402 
1403  // copy ...
1404  UInt_t *shifted_signal =
1405  fSignal + istart;
1406  for(UInt_t i = 0u; i < tocopy; i++) {
1407  sig[i] = Signal::UShort(shifted_signal[i]);
1408  }
1409  return tocopy;
1410  }
1411  virtual Short_t Get(Short_t /*val*/, UInt_t i) const
1412  {
1413  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1414  return Signal::Short(fSignal[fLast]);
1415  }
1416  virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart = 0u) const
1417  {
1418  UInt_t tocopy;
1419  // starting point in this signal should be in the range [0,GetLength()[
1420  if( istart + 1u > GetLength() )
1421  return 0u;
1422 
1423  // compute last value and number of values to be copied
1424  fLast = istart + n;
1425  tocopy = n;
1426  if ( fLast > GetLength() )
1427  { fLast = GetLength(); tocopy = (fLast-istart); }
1428 
1429  // copy ...
1430  UInt_t *shifted_signal =
1431  fSignal + istart;
1432  for(UInt_t i = 0u; i < tocopy; i++) {
1433  sig[i] = Signal::Short(shifted_signal[i]);
1434  }
1435  return tocopy;
1436  }
1437  virtual UInt_t Get(UInt_t /*val*/, UInt_t i) const
1438  {
1439  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1440  return fSignal[fLast];
1441  }
1442  virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart = 0u) const
1443  {
1444  UInt_t tocopy;
1445  // starting point in this signal should be in the range [0,GetLength()[
1446  if( istart + 1u > GetLength() )
1447  return 0u;
1448 
1449  // compute last value and number of values to be copied
1450  fLast = istart + n;
1451  tocopy = n;
1452  if ( fLast > GetLength() )
1453  { fLast = GetLength(); tocopy = (fLast-istart); }
1454 
1455  // copy ...
1456  UInt_t *shifted_signal =
1457  fSignal + istart;
1458  for(UInt_t i = 0u; i < tocopy; i++) {
1459  sig[i] = shifted_signal[i];
1460  }
1461  return tocopy;
1462  }
1463  virtual Int_t Get(Int_t /*val*/, UInt_t i) const
1464  {
1465  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1466  return Signal::Int(fSignal[fLast]);
1467  }
1468  virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart = 0u) const
1469  {
1470  UInt_t tocopy;
1471  // starting point in this signal should be in the range [0,GetLength()[
1472  if( istart + 1u > GetLength() )
1473  return 0u;
1474 
1475  // compute last value and number of values to be copied
1476  fLast = istart + n;
1477  tocopy = n;
1478  if ( fLast > GetLength() )
1479  { fLast = GetLength(); tocopy = (fLast-istart); }
1480 
1481  // copy ...
1482  UInt_t *shifted_signal =
1483  fSignal + istart;
1484  for(UInt_t i = 0u; i < tocopy; i++) {
1485  sig[i] = Signal::Int(shifted_signal[i]);
1486  }
1487  return tocopy;
1488  }
1489  virtual Float_t Get(Float_t /*val*/, UInt_t i) const
1490  {
1491  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1492  return Signal::Float(fSignal[fLast]);
1493  }
1494  virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart = 0u) const
1495  {
1496  UInt_t tocopy;
1497  // starting point in this signal should be in the range [0,GetLength()[
1498  if( istart + 1u > GetLength() )
1499  return 0u;
1500 
1501  // compute last value and number of values to be copied
1502  fLast = istart + n;
1503  tocopy = n;
1504  if ( fLast > GetLength() )
1505  { fLast = GetLength(); tocopy = (fLast-istart); }
1506 
1507  // copy ...
1508  UInt_t *shifted_signal =
1509  fSignal + istart;
1510  for(UInt_t i = 0u; i < tocopy; i++) {
1511  sig[i] = Signal::Float(shifted_signal[i]);
1512  }
1513  return tocopy;
1514  }
1515  virtual Double_t Get(Double_t /*val*/, UInt_t i) const
1516  {
1517  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1518  return Signal::Double(fSignal[fLast]);
1519  }
1520  virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart = 0u) const
1521  {
1522  UInt_t tocopy;
1523  // starting point in this signal should be in the range [0,GetLength()[
1524  if( istart + 1u > GetLength() )
1525  return 0u;
1526 
1527  // compute last value and number of values to be copied
1528  fLast = istart + n;
1529  tocopy = n;
1530  if ( fLast > GetLength() )
1531  { fLast = GetLength(); tocopy = (fLast-istart); }
1532 
1533  // copy ...
1534  UInt_t *shifted_signal =
1535  fSignal + istart;
1536  for(UInt_t i = 0u; i < tocopy; i++) {
1537  sig[i] = Signal::Double(shifted_signal[i]);
1538  }
1539  return tocopy;
1540  }
1541  virtual void Set(UShort_t val, UInt_t i)
1542  {
1543  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1544  fSignal[fLast] = Signal::UInt(val);
1545  }
1546  virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart = 0u)
1547  {
1548  UInt_t tocopy;
1549  // starting point in this signal should be in the range [0,GetLength()[
1550  if( istart + 1u > GetLength() )
1551  return 0u;
1552 
1553  // compute last value and number of values to be copied
1554  fLast = istart + n;
1555  tocopy = n;
1556  if ( fLast > GetLength() )
1557  { fLast = GetLength(); tocopy = (fLast-istart); }
1558 
1559  // copy ...
1560  UInt_t *shifted_signal =
1561  fSignal + istart;
1562  for(UInt_t i = 0u; i < tocopy; i++) {
1563  shifted_signal[i] = Signal::UInt(sig[i]);
1564  }
1565  return tocopy;
1566  }
1567  virtual void Set(Short_t val, UInt_t i)
1568  {
1569  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1570  fSignal[fLast] = Signal::UInt(val);
1571  }
1572  virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart = 0u)
1573  {
1574  UInt_t tocopy;
1575  // starting point in this signal should be in the range [0,GetLength()[
1576  if( istart + 1u > GetLength() )
1577  return 0u;
1578 
1579  // compute last value and number of values to be copied
1580  fLast = istart + n;
1581  tocopy = n;
1582  if ( fLast > GetLength() )
1583  { fLast = GetLength(); tocopy = (fLast-istart); }
1584 
1585  // copy ...
1586  UInt_t *shifted_signal =
1587  fSignal + istart;
1588  for(UInt_t i = 0u; i < tocopy; i++) {
1589  shifted_signal[i] = Signal::UInt(sig[i]);
1590  }
1591  return tocopy;
1592  }
1593  virtual void Set(UInt_t val, UInt_t i)
1594  {
1595  ( i < fLength ) ? fLast = i : fLast = fLength - 1u;
1596  fSignal[fLast] = val;
1597  }
1598  virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart = 0u)
1599  {
1600  UInt_t tocopy;
1601  // starting point in this signal should be in the range [0,GetLength()[
1602  if( istart + 1u > GetLength() )
1603  return 0u;
1604 
1605  // compute last value and number of values to be copied
1606  fLast = istart + n;
1607  tocopy = n;
1608  if ( fLast > GetLength() )
1609  { fLast = GetLength(); tocopy = (fLast-istart); }
1610 
1611  // copy ...
1612  UInt_t *shifted_signal =
1613  fSignal + istart;
1614  for(UInt_t i = 0u; i < tocopy; i++) {
1615  shifted_signal[i] = Signal::UInt(sig[i]);
1616  }
1617  return tocopy;
1618  }
1619  virtual void Set(Int_t val, UInt_t i)
1620  {
1621  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1622  fSignal[fLast] = Signal::UInt(val);
1623  }
1624  virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart = 0u)
1625  {
1626  UInt_t tocopy;
1627  // starting point in this signal should be in the range [0,GetLength()[
1628  if( istart + 1u > GetLength() )
1629  return 0u;
1630 
1631  // compute last value and number of values to be copied
1632  fLast = istart + n;
1633  tocopy = n;
1634  if ( fLast > GetLength() )
1635  { fLast = GetLength(); tocopy = (fLast-istart); }
1636 
1637  // copy ...
1638  UInt_t *shifted_signal =
1639  fSignal + istart;
1640  for(UInt_t i = 0u; i < tocopy; i++) {
1641  shifted_signal[i] = Signal::UInt(sig[i]);
1642  }
1643  return tocopy;
1644  }
1645  virtual void Set(Float_t val, UInt_t i)
1646  {
1647  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1648  fSignal[fLast] = Signal::UInt(val);
1649  }
1650  virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart = 0u)
1651  {
1652  UInt_t tocopy;
1653  // starting point in this signal should be in the range [0,GetLength()[
1654  if( istart + 1u > GetLength() )
1655  return 0u;
1656 
1657  // compute last value and number of values to be copied
1658  fLast = istart + n;
1659  tocopy = n;
1660  if ( fLast > GetLength() )
1661  { fLast = GetLength(); tocopy = (fLast-istart); }
1662 
1663  // copy ...
1664  UInt_t *shifted_signal =
1665  fSignal + istart;
1666  for(UInt_t i = 0u; i < tocopy; i++) {
1667  shifted_signal[i] = Signal::UInt(sig[i]);
1668  }
1669  return tocopy;
1670  }
1671  virtual void Set(Double_t val, UInt_t i)
1672  {
1673  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1674  fSignal[fLast] = Signal::UInt(val);
1675  }
1676  virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart = 0u)
1677  {
1678  UInt_t tocopy;
1679  // starting point in this signal should be in the range [0,GetLength()[
1680  if( istart + 1u > GetLength() )
1681  return 0u;
1682 
1683  // compute last value and number of values to be copied
1684  fLast = istart + n;
1685  tocopy = n;
1686  if ( fLast > GetLength() )
1687  { fLast = GetLength(); tocopy = (fLast-istart); }
1688 
1689  // copy ...
1690  UInt_t *shifted_signal =
1691  fSignal + istart;
1692  for(UInt_t i = 0u; i < tocopy; i++) {
1693  shifted_signal[i] = Signal::UInt(sig[i]);
1694  }
1695  return tocopy;
1696  }
1697 };
1698 
1699 class SignalI : public SignalImp<Int_t>
1700 {
1701 public:
1702  SignalI(UInt_t length):
1703  SignalImp<Int_t>::SignalImp(length) {;}
1704  virtual ~SignalI()
1705  {;}
1706 
1707  virtual UShort_t *Address(const UShort_t *)
1708  { return 0x0; }
1709  virtual Short_t *Address(const Short_t *)
1710  { return 0x0; }
1711  virtual UInt_t *Address(const UInt_t *)
1712  { return 0x0; }
1713  virtual Int_t *Address(const Int_t *)
1714  { return fSignal; }
1715  virtual Float_t *Address(const Float_t *)
1716  { return 0x0; }
1717  virtual Double_t *Address(const Double_t *)
1718  { return 0x0; }
1719 
1720  virtual UShort_t Get(UShort_t /*val*/, UInt_t i) const
1721  {
1722  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1723  return Signal::UShort(fSignal[fLast]);
1724  }
1725  virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart = 0u) const
1726  {
1727  UInt_t tocopy;
1728  // starting point in this signal should be in the range [0,GetLength()[
1729  if( istart + 1u > GetLength() )
1730  return 0u;
1731 
1732  // compute last value and number of values to be copied
1733  fLast = istart + n;
1734  tocopy = n;
1735  if ( fLast > GetLength() )
1736  { fLast = GetLength(); tocopy = (fLast-istart); }
1737 
1738  // copy ... memcpy to be tested in this particular case to see if it speed up things
1739  Int_t *shifted_signal =
1740  fSignal + istart;
1741  for(UInt_t i = 0u; i < tocopy; i++) {
1742  sig[i] = Signal::UShort(shifted_signal[i]);
1743  }
1744 
1745  return tocopy;
1746  }
1747  virtual Short_t Get(Short_t /*val*/, UInt_t i) const
1748  {
1749  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1750  return Signal::Short(fSignal[fLast]);
1751  }
1752  virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart = 0u) const
1753  {
1754  UInt_t tocopy;
1755  // starting point in this signal should be in the range [0,GetLength()[
1756  if( istart + 1u > GetLength() )
1757  return 0u;
1758 
1759  // compute last value and number of values to be copied
1760  fLast = istart + n;
1761  tocopy = n;
1762  if ( fLast > GetLength() )
1763  { fLast = GetLength(); tocopy = (fLast-istart); }
1764 
1765  // copy ... memcpy to be tested in this particular case to see if it speed up things
1766  Int_t *shifted_signal =
1767  fSignal + istart;
1768  for(UInt_t i = 0u; i < tocopy; i++) {
1769  sig[i] = Signal::Short(shifted_signal[i]);
1770  }
1771 
1772  return tocopy;
1773  }
1774  virtual UInt_t Get(UInt_t /*val*/, UInt_t i) const
1775  {
1776  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1777  return Signal::UInt(fSignal[fLast]);
1778  }
1779  virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart = 0u) const
1780  {
1781  UInt_t tocopy;
1782  // starting point in this signal should be in the range [0,GetLength()[
1783  if( istart + 1u > GetLength() )
1784  return 0u;
1785 
1786  // compute last value and number of values to be copied
1787  fLast = istart + n;
1788  tocopy = n;
1789  if ( fLast > GetLength() )
1790  { fLast = GetLength(); tocopy = (fLast-istart); }
1791 
1792  // copy ... memcpy to be tested in this particular case to see if it speed up things
1793  Int_t *shifted_signal =
1794  fSignal + istart;
1795  for(UInt_t i = 0u; i < tocopy; i++) {
1796  sig[i] = Signal::UInt(shifted_signal[i]);
1797  }
1798 
1799  return tocopy;
1800  }
1801  virtual Int_t Get(Int_t /*val*/, UInt_t i) const
1802  {
1803  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1804  return fSignal[fLast];
1805  }
1806  virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart = 0u) const
1807  {
1808  UInt_t tocopy;
1809  // starting point in this signal should be in the range [0,GetLength()[
1810  if( istart + 1u > GetLength() )
1811  return 0u;
1812 
1813  // compute last value and number of values to be copied
1814  fLast = istart + n;
1815  tocopy = n;
1816  if ( fLast > GetLength() )
1817  { fLast = GetLength(); tocopy = (fLast-istart); }
1818 
1819  // copy ... memcpy to be tested in this particular case to see if it speed up things
1820  Int_t *shifted_signal =
1821  fSignal + istart;
1822  for(UInt_t i = 0u; i < tocopy; i++) {
1823  sig[i] = shifted_signal[i];
1824  }
1825 
1826  return tocopy;
1827  }
1828  virtual Float_t Get(Float_t /*val*/, UInt_t i) const
1829  {
1830  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1831  return Signal::Float(fSignal[fLast]);
1832  }
1833  virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart = 0u) const
1834  {
1835  UInt_t tocopy;
1836  // starting point in this signal should be in the range [0,GetLength()[
1837  if( istart + 1u > GetLength() )
1838  return 0u;
1839 
1840  // compute last value and number of values to be copied
1841  fLast = istart + n;
1842  tocopy = n;
1843  if ( fLast > GetLength() )
1844  { fLast = GetLength(); tocopy = (fLast-istart); }
1845 
1846  // copy ... memcpy to be tested in this particular case to see if it speed up things
1847  Int_t *shifted_signal =
1848  fSignal + istart;
1849  for(UInt_t i = 0u; i < tocopy; i++) {
1850  sig[i] = Signal::Float(shifted_signal[i]);
1851  }
1852 
1853  return tocopy;
1854  }
1855  virtual Double_t Get(Double_t /*val*/, UInt_t i) const
1856  {
1857  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1858  return Signal::Double(fSignal[fLast]);
1859  }
1860  virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart = 0u) const
1861  {
1862  UInt_t tocopy;
1863  // starting point in this signal should be in the range [0,GetLength()[
1864  if( istart + 1u > GetLength() )
1865  return 0u;
1866 
1867  // compute last value and number of values to be copied
1868  fLast = istart + n;
1869  tocopy = n;
1870  if ( fLast > GetLength() )
1871  { fLast = GetLength(); tocopy = (fLast-istart); }
1872 
1873  // copy ... memcpy to be tested in this particular case to see if it speed up things
1874  Int_t *shifted_signal =
1875  fSignal + istart;
1876  for(UInt_t i = 0u; i < tocopy; i++) {
1877  sig[i] = Signal::Double(shifted_signal[i]);
1878  }
1879 
1880  return tocopy;
1881  }
1882  virtual void Set(UShort_t val, UInt_t i)
1883  {
1884  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1885  fSignal[fLast] = Signal::Int(val);
1886  }
1887  virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart = 0u)
1888  {
1889  UInt_t tocopy;
1890  // starting point in this signal should be in the range [0,GetLength()[
1891  if( istart + 1u > GetLength() )
1892  return 0u;
1893 
1894  // compute last value and number of values to be copied
1895  fLast = istart + n;
1896  tocopy = n;
1897  if ( fLast > GetLength() )
1898  { fLast = GetLength(); tocopy = (fLast-istart); }
1899 
1900  // copy ...
1901  Int_t *shifted_signal =
1902  fSignal + istart;
1903  for(UInt_t i = 0u; i < tocopy; i++) {
1904  shifted_signal[i] = Signal::Int(sig[i]);
1905  }
1906  return tocopy;
1907  }
1908  virtual void Set(Short_t val, UInt_t i)
1909  {
1910  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1911  fSignal[fLast] = Signal::Int(val);
1912  }
1913  virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart = 0u)
1914  {
1915  UInt_t tocopy;
1916  // starting point in this signal should be in the range [0,GetLength()[
1917  if( istart + 1u > GetLength() )
1918  return 0u;
1919 
1920  // compute last value and number of values to be copied
1921  fLast = istart + n;
1922  tocopy = n;
1923  if ( fLast > GetLength() )
1924  { fLast = GetLength(); tocopy = (fLast-istart); }
1925 
1926  // copy ...
1927  Int_t *shifted_signal =
1928  fSignal + istart;
1929  for(UInt_t i = 0u; i < tocopy; i++) {
1930  shifted_signal[i] = Signal::Int(sig[i]);
1931  }
1932  return tocopy;
1933  }
1934  virtual void Set(UInt_t val, UInt_t i)
1935  {
1936  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1937  fSignal[fLast] = Signal::Int(val);
1938  }
1939  virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart = 0u)
1940  {
1941  UInt_t tocopy;
1942  // starting point in this signal should be in the range [0,GetLength()[
1943  if( istart + 1u > GetLength() )
1944  return 0u;
1945 
1946  // compute last value and number of values to be copied
1947  fLast = istart + n;
1948  tocopy = n;
1949  if ( fLast > GetLength() )
1950  { fLast = GetLength(); tocopy = (fLast-istart); }
1951 
1952  // copy ...
1953  Int_t *shifted_signal =
1954  fSignal + istart;
1955  for(UInt_t i = 0u; i < tocopy; i++) {
1956  shifted_signal[i] = Signal::Int(sig[i]);
1957  }
1958  return tocopy;
1959  }
1960  virtual void Set(Int_t val, UInt_t i)
1961  {
1962  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1963  fSignal[fLast] = val;
1964  }
1965  virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart = 0u)
1966  {
1967  UInt_t tocopy;
1968  // starting point in this signal should be in the range [0,GetLength()[
1969  if( istart + 1u > GetLength() )
1970  return 0u;
1971 
1972  // compute last value and number of values to be copied
1973  fLast = istart + n;
1974  tocopy = n;
1975  if ( fLast > GetLength() )
1976  { fLast = GetLength(); tocopy = (fLast-istart); }
1977 
1978  // copy ...
1979  Int_t *shifted_signal =
1980  fSignal + istart;
1981  for(UInt_t i = 0u; i < tocopy; i++) {
1982  shifted_signal[i] = Signal::Int(sig[i]);
1983  }
1984  return tocopy;
1985  }
1986  virtual void Set(Float_t val, UInt_t i)
1987  {
1988  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
1989  fSignal[fLast] = Signal::Int(val);
1990  }
1991  virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart = 0u)
1992  {
1993  UInt_t tocopy;
1994  // starting point in this signal should be in the range [0,GetLength()[
1995  if( istart + 1u > GetLength() )
1996  return 0u;
1997 
1998  // compute last value and number of values to be copied
1999  fLast = istart + n;
2000  tocopy = n;
2001  if ( fLast > GetLength() )
2002  { fLast = GetLength(); tocopy = (fLast-istart); }
2003 
2004  // copy ...
2005  Int_t *shifted_signal =
2006  fSignal + istart;
2007  for(UInt_t i = 0u; i < tocopy; i++) {
2008  shifted_signal[i] = Signal::Int(sig[i]);
2009  }
2010  return tocopy;
2011  }
2012  virtual void Set(Double_t val, UInt_t i)
2013  {
2014  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2015  fSignal[fLast] = Signal::Int(val);
2016  }
2017  virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart = 0u)
2018  {
2019  UInt_t tocopy;
2020  // starting point in this signal should be in the range [0,GetLength()[
2021  if( istart + 1u > GetLength() )
2022  return 0u;
2023 
2024  // compute last value and number of values to be copied
2025  fLast = istart + n;
2026  tocopy = n;
2027  if ( fLast > GetLength() )
2028  { fLast = GetLength(); tocopy = (fLast-istart); }
2029 
2030  // copy ...
2031  Int_t *shifted_signal =
2032  fSignal + istart;
2033  for(UInt_t i = 0u; i < tocopy; i++) {
2034  shifted_signal[i] = Signal::Int(sig[i]);
2035  }
2036  return tocopy;
2037  }
2038 };
2039 
2040 class SignalF : public SignalImp<Float_t>
2041 {
2042 public:
2043  SignalF(UInt_t length):
2044  SignalImp<Float_t>::SignalImp(length) {;}
2045  virtual ~SignalF()
2046  {;}
2047 
2048  virtual UShort_t *Address(const UShort_t *)
2049  { return 0x0; }
2050  virtual Short_t *Address(const Short_t *)
2051  { return 0x0; }
2052  virtual UInt_t *Address(const UInt_t *)
2053  { return 0x0; }
2054  virtual Int_t *Address(const Int_t *)
2055  { return 0x0; }
2056  virtual Float_t *Address(const Float_t *)
2057  { return fSignal; }
2058  virtual Double_t *Address(const Double_t *)
2059  { return 0x0; }
2060 
2061  virtual UShort_t Get(UShort_t /*val*/, UInt_t i) const
2062  {
2063  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2064  return Signal::UShort(fSignal[fLast]);
2065  }
2066  virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart = 0u) const
2067  {
2068  UInt_t tocopy;
2069  // starting point in this signal should be in the range [0,GetLength()[
2070  if( istart + 1u > GetLength() )
2071  return 0u;
2072 
2073  // compute last value and number of values to be copied
2074  fLast = istart + n;
2075  tocopy = n;
2076  if ( fLast > GetLength() )
2077  { fLast = GetLength(); tocopy = (fLast-istart); }
2078 
2079  // copy ... memcpy to be tested in this particular case to see if it speed up things
2080  Float_t *shifted_signal =
2081  fSignal + istart;
2082  for(UInt_t i = 0u; i < tocopy; i++) {
2083  sig[i] = Signal::UShort(shifted_signal[i]);
2084  }
2085  return tocopy;
2086  }
2087  virtual Short_t Get(Short_t /*val*/, UInt_t i) const
2088  {
2089  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2090  return Signal::Short(fSignal[fLast]);
2091  }
2092  virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart = 0u) const
2093  {
2094  UInt_t tocopy;
2095  // starting point in this signal should be in the range [0,GetLength()[
2096  if( istart + 1u > GetLength() )
2097  return 0u;
2098 
2099  // compute last value and number of values to be copied
2100  fLast = istart + n;
2101  tocopy = n;
2102  if ( fLast > GetLength() )
2103  { fLast = GetLength(); tocopy = (fLast-istart); }
2104 
2105  // copy ... memcpy to be tested in this particular case to see if it speed up things
2106  Float_t *shifted_signal =
2107  fSignal + istart;
2108  for(UInt_t i = 0u; i < tocopy; i++) {
2109  sig[i] = Signal::Short(shifted_signal[i]);
2110  }
2111  return tocopy;
2112  }
2113  virtual UInt_t Get(UInt_t /*val*/, UInt_t i) const
2114  {
2115  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2116  return Signal::UInt(fSignal[fLast]);
2117  }
2118  virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart = 0u) const
2119  {
2120  UInt_t tocopy;
2121  // starting point in this signal should be in the range [0,GetLength()[
2122  if( istart + 1u > GetLength() )
2123  return 0u;
2124 
2125  // compute last value and number of values to be copied
2126  fLast = istart + n;
2127  tocopy = n;
2128  if ( fLast > GetLength() )
2129  { fLast = GetLength(); tocopy = (fLast-istart); }
2130 
2131  // copy ... memcpy to be tested in this particular case to see if it speed up things
2132  Float_t *shifted_signal =
2133  fSignal + istart;
2134  for(UInt_t i = 0u; i < tocopy; i++) {
2135  sig[i] = Signal::UInt(shifted_signal[i]);
2136  }
2137  return tocopy;
2138  }
2139  virtual Int_t Get(Int_t /*val*/, UInt_t i) const
2140  {
2141  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2142  return Signal::Int(fSignal[fLast]);
2143  }
2144  virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart = 0u) const
2145  {
2146  UInt_t tocopy;
2147  // starting point in this signal should be in the range [0,GetLength()[
2148  if( istart + 1u > GetLength() )
2149  return 0u;
2150 
2151  // compute last value and number of values to be copied
2152  fLast = istart + n;
2153  tocopy = n;
2154  if ( fLast > GetLength() )
2155  { fLast = GetLength(); tocopy = (fLast-istart); }
2156 
2157  // copy ... memcpy to be tested in this particular case to see if it speed up things
2158  Float_t *shifted_signal =
2159  fSignal + istart;
2160  for(UInt_t i = 0u; i < tocopy; i++) {
2161  sig[i] = Signal::Int(shifted_signal[i]);
2162  }
2163  return tocopy;
2164  }
2165  virtual Float_t Get(Float_t /*val*/, UInt_t i) const
2166  {
2167  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2168  return fSignal[fLast];
2169  }
2170  virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart = 0u) const
2171  {
2172  UInt_t tocopy;
2173  // starting point in this signal should be in the range [0,GetLength()[
2174  if( istart + 1u > GetLength() )
2175  return 0u;
2176 
2177  // compute last value and number of values to be copied
2178  fLast = istart + n;
2179  tocopy = n;
2180  if ( fLast > GetLength() )
2181  { fLast = GetLength(); tocopy = (fLast-istart); }
2182 
2183  // copy ... memcpy to be tested in this particular case to see if it speed up things
2184  Float_t *shifted_signal =
2185  fSignal + istart;
2186  for(UInt_t i = 0u; i < tocopy; i++) {
2187  sig[i] = shifted_signal[i];
2188  }
2189  return tocopy;
2190  }
2191  virtual Double_t Get(Double_t /*val*/, UInt_t i) const
2192  {
2193  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2194  return fSignal[fLast];
2195  }
2196  virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart = 0u) const
2197  {
2198  UInt_t tocopy;
2199  // starting point in this signal should be in the range [0,GetLength()[
2200  if( istart + 1u > GetLength() )
2201  return 0u;
2202 
2203  // compute last value and number of values to be copied
2204  fLast = istart + n;
2205  tocopy = n;
2206  if ( fLast > GetLength() )
2207  { fLast = GetLength(); tocopy = (fLast-istart); }
2208 
2209  // copy ... memcpy to be tested in this particular case to see if it speed up things
2210  Float_t *shifted_signal =
2211  fSignal + istart;
2212  for(UInt_t i = 0u; i < tocopy; i++) {
2213  sig[i] = Signal::Double(shifted_signal[i]);
2214  }
2215  return tocopy;
2216  }
2217  virtual void Set(UShort_t val, UInt_t i)
2218  {
2219  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2220  fSignal[fLast] = Float_t(val);
2221  }
2222  virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart = 0u)
2223  {
2224  UInt_t tocopy;
2225  // starting point in this signal should be in the range [0,GetLength()[
2226  if( istart + 1u > GetLength() )
2227  return 0u;
2228 
2229  // compute last value and number of values to be copied
2230  fLast = istart + n;
2231  tocopy = n;
2232  if ( fLast > GetLength() )
2233  { fLast = GetLength(); tocopy = (fLast-istart); }
2234 
2235  // copy ...
2236  Float_t *shifted_signal =
2237  fSignal + istart;
2238  for(UInt_t i = 0u; i < tocopy; i++) {
2239  shifted_signal[i] = Signal::Float(sig[i]);
2240  }
2241  return tocopy;
2242  }
2243  virtual void Set(Short_t val, UInt_t i)
2244  {
2245  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2246  fSignal[fLast] = Float_t(val);
2247  }
2248  virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart = 0u)
2249  {
2250  UInt_t tocopy;
2251  // starting point in this signal should be in the range [0,GetLength()[
2252  if( istart + 1u > GetLength() )
2253  return 0u;
2254 
2255  // compute last value and number of values to be copied
2256  fLast = istart + n;
2257  tocopy = n;
2258  if ( fLast > GetLength() )
2259  { fLast = GetLength(); tocopy = (fLast-istart); }
2260 
2261  // copy ...
2262  Float_t *shifted_signal =
2263  fSignal + istart;
2264  for(UInt_t i = 0u; i < tocopy; i++) {
2265  shifted_signal[i] = Signal::Float(sig[i]);
2266  }
2267  return tocopy;
2268  }
2269  virtual void Set(UInt_t val, UInt_t i)
2270  {
2271  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2272  fSignal[fLast] = Float_t(val);
2273  }
2274  virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart = 0u)
2275  {
2276  UInt_t tocopy;
2277  // starting point in this signal should be in the range [0,GetLength()[
2278  if( istart + 1u > GetLength() )
2279  return 0u;
2280 
2281  // compute last value and number of values to be copied
2282  fLast = istart + n;
2283  tocopy = n;
2284  if ( fLast > GetLength() )
2285  { fLast = GetLength(); tocopy = (fLast-istart); }
2286 
2287  // copy ...
2288  Float_t *shifted_signal =
2289  fSignal + istart;
2290  for(UInt_t i = 0u; i < tocopy; i++) {
2291  shifted_signal[i] = Signal::Float(sig[i]);
2292  }
2293  return tocopy;
2294  }
2295  virtual void Set(Int_t val, UInt_t i)
2296  {
2297  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2298  fSignal[fLast] = Float_t(val);
2299  }
2300  virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart = 0u)
2301  {
2302  UInt_t tocopy;
2303  // starting point in this signal should be in the range [0,GetLength()[
2304  if( istart + 1u > GetLength() )
2305  return 0u;
2306 
2307  // compute last value and number of values to be copied
2308  fLast = istart + n;
2309  tocopy = n;
2310  if ( fLast > GetLength() )
2311  { fLast = GetLength(); tocopy = (fLast-istart); }
2312 
2313  // copy ...
2314  Float_t *shifted_signal =
2315  fSignal + istart;
2316  for(UInt_t i = 0u; i < tocopy; i++) {
2317  shifted_signal[i] = Signal::Float(sig[i]);
2318  }
2319  return tocopy;
2320  }
2321  virtual void Set(Float_t val, UInt_t i)
2322  {
2323  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2324  fSignal[fLast] = val;
2325  }
2326  virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart = 0u)
2327  {
2328  UInt_t tocopy;
2329  // starting point in this signal should be in the range [0,GetLength()[
2330  if( istart + 1u > GetLength() )
2331  return 0u;
2332 
2333  // compute last value and number of values to be copied
2334  fLast = istart + n;
2335  tocopy = n;
2336  if ( fLast > GetLength() )
2337  { fLast = GetLength(); tocopy = (fLast-istart); }
2338 
2339  // copy ...
2340  Float_t *shifted_signal =
2341  fSignal + istart;
2342  for(UInt_t i = 0u; i < tocopy; i++) {
2343  shifted_signal[i] = Signal::Float(sig[i]);
2344  }
2345  return tocopy;
2346  }
2347  virtual void Set(Double_t val, UInt_t i)
2348  {
2349  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2350  fSignal[fLast] = Float_t(val);
2351  }
2352  virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart = 0u)
2353  {
2354  UInt_t tocopy;
2355  // starting point in this signal should be in the range [0,GetLength()[
2356  if( istart + 1u > GetLength() )
2357  return 0u;
2358 
2359  // compute last value and number of values to be copied
2360  fLast = istart + n;
2361  tocopy = n;
2362  if ( fLast > GetLength() )
2363  { fLast = GetLength(); tocopy = (fLast-istart); }
2364 
2365  // copy ...
2366  Float_t *shifted_signal =
2367  fSignal + istart;
2368  for(UInt_t i = 0u; i < tocopy; i++) {
2369  shifted_signal[i] = Signal::Float(sig[i]);
2370  }
2371  return tocopy;
2372  }
2373 };
2374 
2375 class SignalD : public SignalImp<Double_t>
2376 {
2377 public:
2378  SignalD(UInt_t length):
2379  SignalImp<Double_t>::SignalImp(length) {;}
2380  virtual ~SignalD()
2381  {;}
2382 
2383  virtual UShort_t *Address(const UShort_t *)
2384  { return 0x0; }
2385  virtual Short_t *Address(const Short_t *)
2386  { return 0x0; }
2387  virtual UInt_t *Address(const UInt_t *)
2388  { return 0x0; }
2389  virtual Int_t *Address(const Int_t *)
2390  { return 0x0; }
2391  virtual Float_t *Address(const Float_t *)
2392  { return 0x0; }
2393  virtual Double_t *Address(const Double_t *)
2394  { return fSignal; }
2395 
2396  virtual UShort_t Get(UShort_t /*val*/, UInt_t i) const
2397  {
2398  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2399  return Signal::UShort(fSignal[fLast]);
2400  }
2401  virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart = 0u) const
2402  {
2403  UInt_t tocopy;
2404  // starting point in this signal should be in the range [0,GetLength()[
2405  if( istart + 1u > GetLength() )
2406  return 0u;
2407 
2408  // compute last value and number of values to be copied
2409  fLast = istart + n;
2410  tocopy = n;
2411  if ( fLast > GetLength() )
2412  { fLast = GetLength(); tocopy = (fLast-istart); }
2413 
2414  // copy ... memcpy to be tested in this particular case to see if it speed up things
2415  Double_t *shifted_signal =
2416  fSignal + istart;
2417  for(UInt_t i = 0u; i < tocopy; i++) {
2418  sig[i] = Signal::UShort(shifted_signal[i]);
2419  }
2420  return tocopy;
2421  }
2422  virtual Short_t Get(Short_t /*val*/, UInt_t i) const
2423  {
2424  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2425  return Signal::Short(fSignal[fLast]);
2426  }
2427  virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart = 0u) const
2428  {
2429  UInt_t tocopy;
2430  // starting point in this signal should be in the range [0,GetLength()[
2431  if( istart + 1u > GetLength() )
2432  return 0u;
2433 
2434  // compute last value and number of values to be copied
2435  fLast = istart + n;
2436  tocopy = n;
2437  if ( fLast > GetLength() )
2438  { fLast = GetLength(); tocopy = (fLast-istart); }
2439 
2440  // copy ... memcpy to be tested in this particular case to see if it speed up things
2441  Double_t *shifted_signal =
2442  fSignal + istart;
2443  for(UInt_t i = 0u; i < tocopy; i++) {
2444  sig[i] = Signal::Short(shifted_signal[i]);
2445  }
2446  return tocopy;
2447  }
2448  virtual UInt_t Get(UInt_t /*val*/, UInt_t i) const
2449  {
2450  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2451  return Signal::UInt(fSignal[fLast]);
2452  }
2453  virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart = 0u) const
2454  {
2455  UInt_t tocopy;
2456  // starting point in this signal should be in the range [0,GetLength()[
2457  if( istart + 1u > GetLength() )
2458  return 0u;
2459 
2460  // compute last value and number of values to be copied
2461  fLast = istart + n;
2462  tocopy = n;
2463  if ( fLast > GetLength() )
2464  { fLast = GetLength(); tocopy = (fLast-istart); }
2465 
2466  // copy ... memcpy to be tested in this particular case to see if it speed up things
2467  Double_t *shifted_signal =
2468  fSignal + istart;
2469  for(UInt_t i = 0u; i < tocopy; i++) {
2470  sig[i] = Signal::UInt(shifted_signal[i]);
2471  }
2472  return tocopy;
2473  }
2474  virtual Int_t Get(Int_t /*val*/, UInt_t i) const
2475  {
2476  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2477  return Signal::Int(fSignal[fLast]);
2478  }
2479  virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart = 0u) const
2480  {
2481  UInt_t tocopy;
2482  // starting point in this signal should be in the range [0,GetLength()[
2483  if( istart + 1u > GetLength() )
2484  return 0u;
2485 
2486  // compute last value and number of values to be copied
2487  fLast = istart + n;
2488  tocopy = n;
2489  if ( fLast > GetLength() )
2490  { fLast = GetLength(); tocopy = (fLast-istart); }
2491 
2492  // copy ... memcpy to be tested in this particular case to see if it speed up things
2493  Double_t *shifted_signal =
2494  fSignal + istart;
2495  for(UInt_t i = 0u; i < tocopy; i++) {
2496  sig[i] = Signal::Int(shifted_signal[i]);
2497  }
2498  return tocopy;
2499  }
2500  virtual Float_t Get(Float_t /*val*/, UInt_t i) const
2501  {
2502  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2503  return Float_t(fSignal[fLast]);
2504  }
2505  virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart = 0u) const
2506  {
2507  UInt_t tocopy;
2508  // starting point in this signal should be in the range [0,GetLength()[
2509  if( istart + 1u > GetLength() )
2510  return 0u;
2511 
2512  // compute last value and number of values to be copied
2513  fLast = istart + n;
2514  tocopy = n;
2515  if ( fLast > GetLength() )
2516  { fLast = GetLength(); tocopy = (fLast-istart); }
2517 
2518  // copy ... memcpy to be tested in this particular case to see if it speed up things
2519  Double_t *shifted_signal =
2520  fSignal + istart;
2521  for(UInt_t i = 0u; i < tocopy; i++) {
2522  sig[i] = Signal::Float(shifted_signal[i]);
2523  }
2524  return tocopy;
2525  }
2526  virtual Double_t Get(Double_t /*val*/, UInt_t i) const
2527  {
2528  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2529  return fSignal[fLast];
2530  }
2531  virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart = 0u) const
2532  {
2533  UInt_t tocopy;
2534  // starting point in this signal should be in the range [0,GetLength()[
2535  if( istart + 1u > GetLength() )
2536  return 0u;
2537 
2538  // compute last value and number of values to be copied
2539  fLast = istart + n;
2540  tocopy = n;
2541  if ( fLast > GetLength() )
2542  { fLast = GetLength(); tocopy = (fLast-istart); }
2543 
2544  // copy ... memcpy to be tested in this particular case to see if it speed up things
2545  Double_t *shifted_signal =
2546  fSignal + istart;
2547  for(UInt_t i = 0u; i < tocopy; i++) {
2548  sig[i] = shifted_signal[i];
2549  }
2550  return tocopy;
2551  }
2552  virtual void Set(UShort_t val, UInt_t i)
2553  {
2554  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2555  fSignal[fLast] = Double_t(val);
2556  }
2557  virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart = 0u)
2558  {
2559  UInt_t tocopy;
2560  // starting point in this signal should be in the range [0,GetLength()[
2561  if( istart + 1u > GetLength() )
2562  return 0u;
2563 
2564  // compute last value and number of values to be copied
2565  fLast = istart + n;
2566  tocopy = n;
2567  if ( fLast > GetLength() )
2568  { fLast = GetLength(); tocopy = (fLast-istart); }
2569 
2570  // copy ...
2571  Double_t *shifted_signal =
2572  fSignal + istart;
2573  for(UInt_t i = 0u; i < tocopy; i++) {
2574  shifted_signal[i] = Signal::Double(sig[i]);
2575  }
2576  return tocopy;
2577  }
2578  virtual void Set(Short_t val, UInt_t i)
2579  {
2580  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2581  fSignal[fLast] = Double_t(val);
2582  }
2583  virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart = 0u)
2584  {
2585  UInt_t tocopy;
2586  // starting point in this signal should be in the range [0,GetLength()[
2587  if( istart + 1u > GetLength() )
2588  return 0u;
2589 
2590  // compute last value and number of values to be copied
2591  fLast = istart + n;
2592  tocopy = n;
2593  if ( fLast > GetLength() )
2594  { fLast = GetLength(); tocopy = (fLast-istart); }
2595 
2596  // copy ...
2597  Double_t *shifted_signal =
2598  fSignal + istart;
2599  for(UInt_t i = 0u; i < tocopy; i++) {
2600  shifted_signal[i] = Signal::Double(sig[i]);
2601  }
2602  return tocopy;
2603  }
2604  virtual void Set(UInt_t val, UInt_t i)
2605  {
2606  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2607  fSignal[fLast] = Double_t(val);
2608  }
2609  virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart = 0u)
2610  {
2611  UInt_t tocopy;
2612  // starting point in this signal should be in the range [0,GetLength()[
2613  if( istart + 1u > GetLength() )
2614  return 0u;
2615 
2616  // compute last value and number of values to be copied
2617  fLast = istart + n;
2618  tocopy = n;
2619  if ( fLast > GetLength() )
2620  { fLast = GetLength(); tocopy = (fLast-istart); }
2621 
2622  // copy ...
2623  Double_t *shifted_signal =
2624  fSignal + istart;
2625  for(UInt_t i = 0u; i < tocopy; i++) {
2626  shifted_signal[i] = Signal::Double(sig[i]);
2627  }
2628  return tocopy;
2629  }
2630  virtual void Set(Int_t val, UInt_t i)
2631  {
2632  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2633  fSignal[fLast] = Double_t(val);
2634  }
2635  virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart = 0u)
2636  {
2637  UInt_t tocopy;
2638  // starting point in this signal should be in the range [0,GetLength()[
2639  if( istart + 1u > GetLength() )
2640  return 0u;
2641 
2642  // compute last value and number of values to be copied
2643  fLast = istart + n;
2644  tocopy = n;
2645  if ( fLast > GetLength() )
2646  { fLast = GetLength(); tocopy = (fLast-istart); }
2647 
2648  // copy ...
2649  Double_t *shifted_signal =
2650  fSignal + istart;
2651  for(UInt_t i = 0u; i < tocopy; i++) {
2652  shifted_signal[i] = Signal::Double(sig[i]);
2653  }
2654  return tocopy;
2655  }
2656  virtual void Set(Float_t val, UInt_t i)
2657  {
2658  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2659  fSignal[fLast] = Double_t(val);
2660  }
2661  virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart = 0u)
2662  {
2663  UInt_t tocopy;
2664  // starting point in this signal should be in the range [0,GetLength()[
2665  if( istart + 1u > GetLength() )
2666  return 0u;
2667 
2668  // compute last value and number of values to be copied
2669  fLast = istart + n;
2670  tocopy = n;
2671  if ( fLast > GetLength() )
2672  { fLast = GetLength(); tocopy = (fLast-istart); }
2673 
2674  // copy ...
2675  Double_t *shifted_signal =
2676  fSignal + istart;
2677  for(UInt_t i = 0u; i < tocopy; i++) {
2678  shifted_signal[i] = Signal::Double(sig[i]);
2679  }
2680  return tocopy;
2681  }
2682  virtual void Set(Double_t val, UInt_t i)
2683  {
2684  ( i < GetLength() ) ? fLast = i : fLast = GetLength() - 1u;
2685  fSignal[fLast] = val;
2686  }
2687  virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart = 0u)
2688  {
2689  UInt_t tocopy;
2690  // starting point in this signal should be in the range [0,GetLength()[
2691  if( istart + 1u > GetLength() )
2692  return 0u;
2693 
2694  // compute last value and number of values to be copied
2695  fLast = istart + n;
2696  tocopy = n;
2697  if ( fLast > GetLength() )
2698  { fLast = GetLength(); tocopy = (fLast-istart); }
2699 
2700  // copy ...
2701  Double_t *shifted_signal =
2702  fSignal + istart;
2703  for(UInt_t i = 0u; i < tocopy; i++) {
2704  shifted_signal[i] = sig[i];
2705  }
2706  return tocopy;
2707  }
2708 };
2709 
2710 } // namespace ADF
2711 #endif
2712 
2713 
2714 
2715 
2716 
static Float_t Float(Short_t val)
to convert a Short to Float_t taking into account type's ranges
Definition: Signals.h:299
SignalUI(UInt_t length)
Definition: Signals.h:1367
virtual UInt_t Import(const BufferIO *buf, const Char_t opt= '_')=0
Read the signal into a Buffer.
virtual UShort_t Get(UShort_t, UInt_t i) const
Method to get the value for a particular bin of the signal.
Definition: Signals.h:1720
virtual Float_t Get(Float_t, UInt_t i) const
Definition: Signals.h:2165
static Int_t Int(Int_t val)
to convert an Int_t to UShortInt_t taking into account type's ranges
Definition: Signals.h:255
static Short_t Short(Float_t val)
to convert a Float_t to Short taking into account type's ranges
Definition: Signals.h:159
const Int_t kMinInt_t
Definition: ADFConfig.h:102
virtual Double_t * Address(const Double_t *)
Definition: Signals.h:425
virtual Short_t * Address(const Short_t *)
Definition: Signals.h:417
virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1237
virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2583
virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2144
static Double_t Double(Short_t val)
to convert a Short to Double_t taking into account type's ranges
Definition: Signals.h:329
virtual void Set(Float_t val, UInt_t i)
Definition: Signals.h:975
virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:954
virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart=0u) const
Method to extract a subset of the signal with conversion.
Definition: Signals.h:1725
virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:824
virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2248
virtual void Set(Short_t val, UInt_t i)
Definition: Signals.h:2578
virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2479
static UShort_t UShort(Int_t val)
to convert an Int_t to UShort taking into account type's ranges
Definition: Signals.h:68
static UInt_t UInt(Int_t val)
to convert an Int_t to UInt_t taking into account type's ranges
Definition: Signals.h:202
static Float_t Float(UInt_t val)
to convert a UInt_t to Float_t taking into account type's ranges
Definition: Signals.h:314
virtual Float_t Get(Float_t, UInt_t i) const
Definition: Signals.h:819
virtual void Set(UShort_t val, UInt_t i)
Method to set the value for a particular bin of the signal.
Definition: Signals.h:1882
virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1494
static Short_t Short(Double_t val)
to convert a Double_t to Short taking into account type's ranges
Definition: Signals.h:173
virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:928
virtual UShort_t Get(UShort_t, UInt_t) const =0
Method to get the value for a particular bin of the signal.
virtual Double_t * Address(const Double_t *)
Definition: Signals.h:1047
UInt_t fLast
Definition: Signals.h:42
virtual Double_t Get(Double_t, UInt_t i) const
Definition: Signals.h:1515
virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:772
virtual Int_t Get(Int_t, UInt_t i) const
Definition: Signals.h:1128
static Double_t Double(Int_t val)
to convert an Int_t to Double_t taking into account type's ranges
Definition: Signals.h:339
static Float_t Float(Float_t val)
to convert a Float_t to Float_t taking into account type's ranges
Definition: Signals.h:319
virtual void Set(Int_t val, UInt_t i)
Definition: Signals.h:2630
virtual UInt_t * Address(const UInt_t *)
Definition: Signals.h:1376
virtual Short_t * Address(const Short_t *)
Definition: Signals.h:1039
static Float_t Float(UShort_t val)
to convert a UShort to Float_t taking into account type's ranges
Definition: Signals.h:304
virtual void Set(Double_t val, UInt_t i)
Definition: Signals.h:1671
static Signal * New(UInt_t length, const char *type="US")
method to allocate a new signal
Definition: Signals.cpp:27
virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1913
static Float_t Float(Int_t val)
to convert an Int_t to Float_t taking into account type's ranges
Definition: Signals.h:309
virtual Double_t Get(Double_t, UInt_t i) const
Definition: Signals.h:2191
UInt_t fRealLength
length of the signal
Definition: Signals.h:530
static UShort_t UShort(UShort_t val)
to convert a UShort to UShort taking into account type's ranges
Definition: Signals.h:63
virtual UInt_t Export(BufferIO *buf, const Char_t opt= '_') const =0
Write the signal into a Buffer.
virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1860
virtual Float_t * Address(const Float_t *)
Definition: Signals.h:1715
static void Delete(Char_t *p)
Definition: BaseBuffer.h:151
SignalF(UInt_t length)
Definition: Signals.h:2043
virtual UInt_t GetLast() const
Return the real last position used.
Definition: Signals.h:376
virtual Short_t * Address(const Short_t *)
Definition: Signals.h:1374
virtual void Set(UShort_t val, UInt_t i)
Method to set the value for a particular bin of the signal.
Definition: Signals.h:1541
virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2352
virtual UInt_t * Address(const UInt_t *)
Definition: Signals.h:1041
virtual Float_t * Address(const Float_t *)
Definition: Signals.h:1045
virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2453
virtual Float_t * Address(const Float_t *)
Definition: Signals.h:710
virtual UShort_t * Address(const UShort_t *)
To have a direct access to the underlying array.
Definition: Signals.h:1037
SignalS(UInt_t length)
Definition: Signals.h:1032
virtual UShort_t * Address(const UShort_t *)
To have a direct access to the underlying array.
Definition: Signals.h:415
virtual Int_t * Address(const Int_t *)
Definition: Signals.h:1043
virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:980
const Int_t kMinShort_t
Definition: ADFConfig.h:98
virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1572
static UShort_t UShort(Float_t val)
to convert a Float_t to UShort taking into account type's ranges
Definition: Signals.h:92
virtual void Set(Double_t val, UInt_t i)
Definition: Signals.h:2682
const UInt_t kMaxUInt_t
Definition: ADFConfig.h:100
virtual Int_t Get(Int_t, UInt_t i) const
Definition: Signals.h:2139
virtual UInt_t Get(UInt_t, UInt_t i) const
Definition: Signals.h:1774
virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1752
virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2170
virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart=0u) const
Method to extract a subset of the signal with conversion.
Definition: Signals.h:1390
static void Zero(Char_t *p, Int_t nb)
Definition: BaseBuffer.h:108
virtual UInt_t GetLength() const
Definition: Signals.h:591
virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1624
static Float_t Float(Double_t val)
to convert a Double_t to Float_t taking into account type's ranges
Definition: Signals.h:324
virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1598
virtual Bool_t Resize(UInt_t, Char_t)=0
virtual Double_t * Address(const Double_t *)
Definition: Signals.h:712
SignalImp(UInt_t length)
Definition: Signals.h:535
virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1468
virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2505
virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart=0u)
Method to initialize a subset or the full signal from an array.
Definition: Signals.h:1211
virtual Int_t Get(Int_t, UInt_t i) const
Definition: Signals.h:2474
virtual void Set(UInt_t val, UInt_t i)
Definition: Signals.h:923
virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2118
virtual Short_t Get(Short_t, UInt_t i) const
Definition: Signals.h:741
virtual UInt_t GetLength() const =0
virtual void Reset(UInt_t l=0u)=0
Get the signal from the given array.
const UInt_t kMaxUShort_t
Definition: ADFConfig.h:96
virtual Bool_t Resize(UInt_t length, char c= '0')
Definition: Signals.h:594
T * fSignal
Real length of the signal.
Definition: Signals.h:532
virtual Short_t Get(Short_t, UInt_t i) const
Definition: Signals.h:1411
virtual UInt_t Get(UInt_t, UInt_t i) const
Definition: Signals.h:1437
virtual Short_t * Address(const Short_t *)
Definition: Signals.h:1709
virtual void Set(UInt_t val, UInt_t i)
Definition: Signals.h:2269
virtual void Set(Float_t val, UInt_t i)
Definition: Signals.h:1645
virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart=0u) const
Method to extract a subset of the signal with conversion.
Definition: Signals.h:1055
virtual Double_t Get(Double_t, UInt_t i) const
Definition: Signals.h:1180
UInt_t Offset() const
it returns the current position in the buffer
Definition: BufferIO.h:240
virtual UInt_t Set(const Short_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:902
virtual UInt_t Get(UInt_t, UInt_t i) const
Definition: Signals.h:1102
virtual void Set(Short_t val, UInt_t i)
Definition: Signals.h:897
static Int_t Int(UInt_t val)
to convert a UInt_t to Int_t taking into account type's ranges
Definition: Signals.h:260
UInt_t fLength
Definition: Signals.h:529
static UShort_t UShort(Short_t val)
to convert a Short to UShort taking into account type's ranges
Definition: Signals.h:53
virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2427
static UInt_t UInt(Double_t val)
to convert a Double_t to UInt_t taking into account type's ranges
Definition: Signals.h:231
virtual Double_t Get(Double_t, UInt_t i) const
Definition: Signals.h:845
static Int_t Int(UShort_t val)
to convert a UShort to Int_t taking into account type's ranges
Definition: Signals.h:250
SignalD(UInt_t length)
Definition: Signals.h:2378
virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1081
virtual void Set(UInt_t val, UInt_t i)
Definition: Signals.h:1934
virtual UShort_t Get(UShort_t, UInt_t i) const
Method to get the value for a particular bin of the signal.
Definition: Signals.h:1385
virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:850
virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1315
virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:798
virtual UInt_t Get(UInt_t, UInt_t i) const
Definition: Signals.h:2448
Base class for a Signal.
Definition: Signals.h:39
virtual Int_t Get(Int_t, UInt_t i) const
Definition: Signals.h:793
virtual void Set(Int_t val, UInt_t i)
Definition: Signals.h:949
virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2609
SignalI(UInt_t length)
Definition: Signals.h:1702
virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1833
static UShort_t UShort(Double_t val)
to convert a Double_t to UShort taking into account type's ranges
Definition: Signals.h:106
virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1806
static UInt_t UInt(UInt_t val)
to convert a UInt_t to UInt_t taking into account type's ranges
Definition: Signals.h:212
virtual void Set(UInt_t val, UInt_t i)
Definition: Signals.h:1258
virtual Float_t Get(Float_t, UInt_t i) const
Definition: Signals.h:2500
virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1185
virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2017
virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1939
header file for BufferIO.cpp
virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart=0u) const
Method to extract a subset of the signal with conversion.
Definition: Signals.h:2066
virtual Short_t * Address(const Short_t *)
Definition: Signals.h:2385
SignalUS(UInt_t length)
Definition: Signals.h:697
virtual UShort_t Get(UShort_t, UInt_t i) const
Method to get the value for a particular bin of the signal.
Definition: Signals.h:2396
virtual Int_t Get(Int_t, UInt_t i) const
Definition: Signals.h:1801
virtual void Set(Short_t val, UInt_t i)
Definition: Signals.h:1232
virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1991
virtual UInt_t Export(Char_t *, UInt_t) const
Export this buffer to an array.
Definition: BufferIO.h:694
virtual void Set(UShort_t val, UInt_t i)
Method to set the value for a particular bin of the signal.
Definition: Signals.h:2552
virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1676
virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1006
virtual UShort_t Get(UShort_t, UInt_t i) const
Method to get the value for a particular bin of the signal.
Definition: Signals.h:2061
virtual Float_t Get(Float_t, UInt_t i) const
Definition: Signals.h:1489
virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1107
virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1650
virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1263
virtual Double_t * Address(const Double_t *)
Definition: Signals.h:1717
virtual void Set(UShort_t, UInt_t)=0
Method to set the value for a particular bin of the signal.
virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1289
virtual Int_t * Address(const Int_t *)
Definition: Signals.h:421
virtual void Set(Float_t val, UInt_t i)
Definition: Signals.h:2321
static Double_t Double(Double_t val)
to convert a Double_t to Double_t taking into account type's ranges
Definition: Signals.h:354
virtual void Set(Int_t val, UInt_t i)
Definition: Signals.h:1619
virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1779
virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart=0u)
Method to initialize a subset or the full signal from an array.
Definition: Signals.h:876
virtual void Set(Short_t val, UInt_t i)
Definition: Signals.h:2243
virtual void Set(UInt_t val, UInt_t i)
Definition: Signals.h:1593
to set informations about the ADF configuration
static Short_t Short(UInt_t val)
to convert a UInt_t to Short taking into account type's ranges
Definition: Signals.h:149
virtual ~SignalUS()
Definition: Signals.h:699
virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:746
virtual void Reset(UInt_t l=0u)
Get the signal from the given array.
Definition: Signals.h:605
static Short_t Short(Int_t val)
to convert an Int_t to Short taking into account type's ranges
Definition: Signals.h:135
virtual ~SignalD()
Definition: Signals.h:2380
virtual UInt_t * Address(const UInt_t *)
Definition: Signals.h:2052
virtual UInt_t Import(const BufferIO *buf, const Char_t opt= '_')
Read the signal into a Buffer.
Definition: Signals.h:665
virtual Bool_t SetAddress(Char_t *external_sig=0x0, UInt_t length=0u)
To attach an external array (to avoid copies)
Definition: Signals.h:612
virtual UShort_t * Address(const UShort_t *)
To have a direct access to the underlying array.
Definition: Signals.h:702
virtual Int_t * Address(const Int_t *)
Definition: Signals.h:708
static Int_t Int(Short_t val)
to convert a Short to Int_t taking into account type's ranges
Definition: Signals.h:245
virtual void Set(UShort_t val, UInt_t i)
Method to set the value for a particular bin of the signal.
Definition: Signals.h:871
virtual UShort_t Get(UShort_t, UInt_t i) const
Method to get the value for a particular bin of the signal.
Definition: Signals.h:715
virtual void Set(UShort_t val, UInt_t i)
Method to set the value for a particular bin of the signal.
Definition: Signals.h:1206
virtual UInt_t Get(UInt_t, UInt_t i) const
Definition: Signals.h:767
virtual ~SignalUI()
Definition: Signals.h:1369
virtual ~SignalS()
Definition: Signals.h:1034
virtual UShort_t * Address(const UShort_t *)
To have a direct access to the underlying array.
Definition: Signals.h:2048
virtual UInt_t Get(UInt_t, UInt_t i) const
Definition: Signals.h:2113
static Char_t * New(Char_t *p, Int_t nb=32 *aKByte)
Definition: BaseBuffer.h:209
virtual ~SignalF()
Definition: Signals.h:2045
static UInt_t UInt(UShort_t val)
to convert a UShort to UInt_t taking into account type's ranges
Definition: Signals.h:197
virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart=0u)
Method to initialize a subset or the full signal from an array.
Definition: Signals.h:2222
virtual ~SignalImp()
Definition: Signals.h:584
virtual Double_t operator[](UInt_t i) const
Definition: Signals.h:483
virtual UInt_t * Address(const UInt_t *)
Definition: Signals.h:419
virtual UShort_t * Address(const UShort_t *)
To have a direct access to the underlying array.
Definition: Signals.h:2383
static Double_t Double(UShort_t val)
to convert a UShort to Double_t taking into account type's ranges
Definition: Signals.h:334
virtual Int_t * Address(const Int_t *)
Definition: Signals.h:2054
virtual Short_t Get(Short_t, UInt_t i) const
Definition: Signals.h:1747
virtual Double_t Get(Double_t, UInt_t i) const
Definition: Signals.h:2526
virtual Double_t Get(Double_t, UInt_t i) const
Definition: Signals.h:1855
virtual UShort_t * Address(const UShort_t *)
To have a direct access to the underlying array.
Definition: Signals.h:1707
virtual Int_t * Address(const Int_t *)
Definition: Signals.h:2389
virtual void Set(Short_t val, UInt_t i)
Definition: Signals.h:1908
virtual ~Signal()
Definition: Signals.h:49
virtual UShort_t Get(UShort_t, UInt_t i) const
Method to get the value for a particular bin of the signal.
Definition: Signals.h:1050
virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2196
virtual Bool_t Reserve(UInt_t length, char c= '0')
to change the size of the current array
Definition: Signals.h:550
virtual Short_t * Address(const Short_t *)
Definition: Signals.h:2050
UInt_t Import(const Char_t *from, UInt_t size_ext_buf)
Import the given array in this buffer.
Definition: BufferIO.cpp:298
virtual UInt_t Get(UInt_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1442
static UInt_t UInt(Float_t val)
to convert a Float_t to UInt_t taking into account type's ranges
Definition: Signals.h:217
virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2092
virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:2531
virtual Short_t Get(Short_t, UInt_t i) const
Definition: Signals.h:2087
virtual Float_t Get(Float_t, UInt_t i) const
Definition: Signals.h:1154
virtual void Set(Int_t val, UInt_t i)
Definition: Signals.h:1960
static Double_t Double(Float_t val)
to convert a Float_t to Double_t taking into account type's ranges
Definition: Signals.h:349
virtual Float_t * Address(const Float_t *)
Definition: Signals.h:2391
virtual UInt_t Set(const UInt_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2274
virtual UInt_t * Address(const UInt_t *)
Definition: Signals.h:2387
virtual UInt_t Get(Int_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1133
const Int_t kMaxInt_t
Definition: ADFConfig.h:101
static Double_t Double(UInt_t val)
to convert a UInt_t to Double_t taking into account type's ranges
Definition: Signals.h:344
virtual void Set(Int_t val, UInt_t i)
Definition: Signals.h:1284
virtual Short_t Get(Short_t, UInt_t i) const
Definition: Signals.h:2422
static UInt_t UInt(Short_t val)
to convert a Short to UInt_t taking into account type's ranges
Definition: Signals.h:187
virtual ~SignalI()
Definition: Signals.h:1704
virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart=0u) const
Method to extract a subset of the signal with conversion.
Definition: Signals.h:2401
virtual UShort_t * Address(const UShort_t *)
To have a direct access to the underlying array.
Definition: Signals.h:1372
virtual void Set(Double_t val, UInt_t i)
Definition: Signals.h:1001
virtual UInt_t Export(BufferIO *buf, const Char_t opt= '_') const
Write the signal into a Buffer.
Definition: Signals.h:645
virtual Bool_t SetAddress(Char_t *=0x0, UInt_t=0u)
To attach an external array (to avoid copies)
Definition: Signals.h:406
virtual Float_t Get(Float_t, UInt_t i) const
Definition: Signals.h:1828
virtual void Set(Float_t val, UInt_t i)
Definition: Signals.h:1986
virtual void Set(UInt_t val, UInt_t i)
Definition: Signals.h:2604
virtual UInt_t Get(Float_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1159
const Int_t size
Definition: BenchIO.C:24
virtual void Set(Int_t val, UInt_t i)
Definition: Signals.h:2295
virtual Int_t Get(Int_t, UInt_t i) const
Definition: Signals.h:1463
const Int_t kMaxShort_t
Definition: ADFConfig.h:97
virtual Float_t * Address(const Float_t *)
Definition: Signals.h:1380
virtual Float_t * Address(const Float_t *)
Definition: Signals.h:2056
virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2661
virtual void Set(Float_t val, UInt_t i)
Definition: Signals.h:2656
virtual void Set(Float_t val, UInt_t i)
Definition: Signals.h:1310
virtual Double_t * Address(const Double_t *)
Definition: Signals.h:2393
virtual Int_t * Address(const Int_t *)
Definition: Signals.h:1378
virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart=0u)
Method to initialize a subset or the full signal from an array.
Definition: Signals.h:1546
virtual UInt_t * Address(const UInt_t *)
Definition: Signals.h:706
virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1965
Signal()
temporary
Definition: Signals.h:45
virtual Short_t Get(Short_t, UInt_t i) const
Definition: Signals.h:1076
virtual UInt_t SizeOf(const Char_t opt= '_')
In memory size for the signal.
Definition: Signals.h:597
virtual Double_t * Address(const Double_t *)
Definition: Signals.h:2058
virtual Short_t * Address(const Short_t *)
Definition: Signals.h:704
virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart=0u)
Method to initialize a subset or the full signal from an array.
Definition: Signals.h:1887
static Int_t Int(Float_t val)
to convert a Float_t to Int_t taking into account type's ranges
Definition: Signals.h:271
virtual Double_t * Address(const Double_t *)
Definition: Signals.h:1382
virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2300
static Short_t Short(UShort_t val)
to convert a UShort to Short taking into account type's ranges
Definition: Signals.h:125
virtual void Set(Double_t val, UInt_t i)
Definition: Signals.h:2012
static UShort_t UShort(UInt_t val)
to convert a UInt_t to UShort taking into account type's ranges
Definition: Signals.h:82
virtual void Set(Double_t val, UInt_t i)
Definition: Signals.h:1336
virtual void Set(UShort_t val, UInt_t i)
Method to set the value for a particular bin of the signal.
Definition: Signals.h:2217
virtual UInt_t Get(Short_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1416
virtual UInt_t SizeOf(const Char_t opt= '_')=0
In memory size for the signal.
virtual UInt_t Set(const Float_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2326
static Int_t Int(Double_t val)
to convert a Double_t to Int_t taking into account type's ranges
Definition: Signals.h:285
virtual UInt_t * Address(const UInt_t *)
Definition: Signals.h:1711
virtual UInt_t Set(const Int_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2635
virtual Int_t * Address(const Int_t *)
Definition: Signals.h:1713
virtual UInt_t Set(const UShort_t *sig, UInt_t n, UInt_t istart=0u)
Method to initialize a subset or the full signal from an array.
Definition: Signals.h:2557
virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:2687
virtual UInt_t Get(Double_t *sig, UInt_t n, UInt_t istart=0u) const
Definition: Signals.h:1520
virtual UInt_t Set(const Double_t *sig, UInt_t n, UInt_t istart=0u)
Definition: Signals.h:1341
virtual Float_t * Address(const Float_t *)
Definition: Signals.h:423
UInt_t SetOffset(UInt_t off=0u) const
change the current position.
Definition: BufferIO.cpp:122
virtual void Set(Double_t val, UInt_t i)
Definition: Signals.h:2347
virtual UInt_t Get(UShort_t *sig, UInt_t n, UInt_t istart=0u) const
Method to extract a subset of the signal with conversion.
Definition: Signals.h:720
static Short_t Short(Short_t val)
to convert a Short to Short taking into account type's ranges
Definition: Signals.h:120
virtual void Set(Short_t val, UInt_t i)
Definition: Signals.h:1567