CDF II
CDF KITS
source navigation ]
diff markup ]
identifier search ]
freetext search ]
file search ]
 
Architecture: i386 ]
Version: 4.10.4 ] [ 4.10.5 ] [ 4.8.4 ] [ 4.8.4l3s ] [ 4.8.5 ] [ 4.9.0 ] [ 4.9.1 ] [ 4.9.1.hpt3 ] [ 4.9.1hpt3 ] [ 4.9.1top1 ] [ 5.0.0 ] [ 5.1.0 ] [ 5.1.0beamonly ] [ 5.1.1 ] [ 5.2.0 ] [ 5.3.0 ] [ 5.3.1 ] [ 5.3.1dsp ] [ 5.3.3 ] [ 5.3.3_nt ] [ 5.3.4 ] [ 6.1.1 ] [ 6.1.1b ] [ 6.1.2 ] [ 6.1.3 ] [ 6.1.4 ] [ 6.1.4int3 ] [ 6.1.4mc ] [ 6.1.4mc_a ] [ 6.1.6 ] [ development ]

001 //*****************************************************************************
002 // File:      VTVZ_StorableBank.cc
003 // ----------------------------------------------------------------------------
004 // Type:      Class implementation source
005 // Package:   StorableBanks
006 // Class:     VTVZ_StorableBank
007 // Language:  Standard C++
008 // Project:   CDF Run II Offline Software Upgrade
009 // OrigAuth:  Robert D. Kennedy
010 // Company:   Fermilab
011 //=============================================================================
012 // RCS Current Revision Record
013 //-----------------------------------------------------------------------------
014 // $Source: /cdf/code/cdfcvs/run2/StorableBanks/src/VTVZ_StorableBank.cc,v $
015 // $Revision: 1.14 $
016 // $Date: 2002/07/17 18:30:05 $
017 // $Author: kennedy $
018 // $State: Exp $
019 // $Locker:  $
020 //*****************************************************************************
021 //=============================================================================
022 // Declarations and Definitions
023 //=============================================================================
024 #ifndef   STORABLEBANKS_VTVZ_STORABLEBANK_HH
025 #include "StorableBanks/VTVZ_StorableBank.hh"
026 #endif
027 
028 #include "Trybos/TRY_Bank_Name.hh"
029 #include "Trybos/TRY_Bank_Number.hh"
030 #include "Trybos/TRY_Bank_Type.hh"
031 
032 #include <iostream>
033 #include <iomanip>
034 
035 #if defined (__GNUG__) && (__GNUC_MAJOR__ == 2) && (__GNUC_MINOR__ <= 95)
036 # define istringstream istrstream
037 # define ostringstream ostrstream
038 # include  <strstream>
039 #else                                        // Standard C++
040 # include  <sstream>
041 #endif
042 
043 
044 //*****************************************************************************
045 // Class Implementation
046 //*****************************************************************************
047 //=============================================================================
048 // Class constants
049 //=============================================================================
050 const uint4 VTVZ_StorableBank_format::n_ztrack_mask        = 0xffff ;
051 const uint4 VTVZ_StorableBank_format::n_ztrack_shift       = 0 ;
052 const uint4 VTVZ_StorableBank_format::n_forward_mask       = 0xffff0000 ;
053 const uint4 VTVZ_StorableBank_format::n_forward_shift      = 16 ;
054 
055 const uint4 VTVZ_StorableBank_format::n_hit_mask           = 0xfff ;
056 const uint4 VTVZ_StorableBank_format::n_hit_shift          = 0 ;
057 const uint4 VTVZ_StorableBank_format::n_segment_mask       = 0x3ff000 ;
058 const uint4 VTVZ_StorableBank_format::n_segment_shift      = 12 ;
059 const uint4 VTVZ_StorableBank_format::position_at_z0_mask  = 0xffff ;
060 const uint4 VTVZ_StorableBank_format::position_at_z0_shift = 0 ;
061 const uint4 VTVZ_StorableBank_format::deriv_wrt_z_mask     = 0xffff0000 ;
062 const uint4 VTVZ_StorableBank_format::deriv_wrt_z_shift    = 16 ;
063 
064 VTVZ_StorableBank_format::BeamDecodeUnion VTVZ_StorableBank_format::bmDecode = { 0 } ;
065 
066 //=============================================================================
067 // Constructors and Assignment
068 //=============================================================================
069 VTVZ_StorableBank::
070 VTVZ_StorableBank(void):
071      StorableBank(form_bank_name(), 0, form_bank_type())
072 { }
073 
074 VTVZ_StorableBank::
075 VTVZ_StorableBank(const VTVZ_StorableBank& bank):
076      StorableBank(bank)
077 { }
078 
079 VTVZ_StorableBank&
080 VTVZ_StorableBank::
081 operator = (const VTVZ_StorableBank& bank)
082 { if (this != &bank)
083     { StorableBank::assign(bank) ;
084     }
085   return(*this) ;
086 }
087 
088 VTVZ_StorableBank::
089 VTVZ_StorableBank(const TRY_Bank_Number& bank_number,
090                   const int nVertices):
091      StorableBank(form_bank_name(), bank_number, form_bank_type(nVertices))
092 {  }
093 
094 VTVZ_StorableBank::
095 VTVZ_StorableBank(const TRY_Generic_Bank& my_bank):
096      StorableBank(my_bank)
097 { // Test that my_bank has same bank name as this class is expected to have
098 }
099 
100 //=============================================================================
101 // Destructors
102 //=============================================================================
103 VTVZ_StorableBank::
104 ~VTVZ_StorableBank(void)
105 { }
106 
107 //=============================================================================
108 // Classifiers
109 //=============================================================================
110 std::string
111 VTVZ_StorableBank::
112 class_name(void) const
113 { return(VTVZ_StorableBank::Class_Name()) ;
114 }
115 
116 Version_t
117 VTVZ_StorableBank::
118 class_version(void) const
119 { return(VTVZ_StorableBank::Class_Version()) ;
120 }
121 
122 TRY_Bank_Name
123 VTVZ_StorableBank::
124 form_bank_name(void)
125 { return( TRY_Bank_Name("VTVZ") ) ;
126 }
127 
128 TRY_Bank_Type
129 VTVZ_StorableBank::
130 form_bank_type(int nVertex)
131 { std::string typeString("(");
132   typeString += VTVZ_StorableBank_format::headerTypeString() ;
133   typeString += ',' ;
134 
135   std::ostringstream temp;
136   temp << nVertex ;
137   typeString += temp.str() ;
138 
139   typeString += '(' ;
140   typeString += VTVZ_StorableBank_format::vertexTypeString() ;
141   typeString += "))" ;
142   return TRY_Bank_Type( typeString ) ;
143 }
144 
145 //=============================================================================
146 // method: print()
147 //=============================================================================
148 void
149 VTVZ_StorableBank::
150 print(std::ostream& output) const
151 {
152   output << std::endl;
153   if ( run1_bank() )
154   {
155     output << "Run1 VTVZ bank" ;
156   }
157   else
158   {
159     output << "Run2 VTVZ bank" ;
160   }
161   output << "  Data length = " << n_data_words() 
162          << "  Vertex block length = " << n_words_per_vertex() << std::endl;
163 
164   output << "N vertices = " << n_vertex() 
165          << ",  N primaries = " << n_prim_vertex() << std::endl;
166   output << "Bank status = " << bank_status_word() << std::endl;
167   int n;
168   Vertex_Iter i;
169   for ( i.assign( *this ), n = 0 ; i.isValid() ; ++i, ++n )
170   {
171     output << "  Vert " << n 
172            << "  Class = " << vertex_class( i )
173            << "  Z = " << z( i )
174            << "  Zrms = " << z_rms( i ) ;
175     if ( run2_bank() )
176     {
177       output << "  Nforw = " << nForward( i ) 
178              << "  Nback = " << nZtracks( i ) - nForward( i ) ;
179       // output << "  History = " << history( i ) ;
180     }
181     else
182     {
183       output << "  Nhit = " << nHit( i )
184              << "  NSeg = " << nSegment( i ) 
185              << "  t0 = " << t0( i ) ;
186     }    
187     output << std::endl ;
188   }
189   if ( run1_bank() && 
190        (bank_status_word() >= VTVZ_StorableBank_format::CTC_beam_position) )
191   {
192     output << "Beam x0 = " << beam_x0()
193            << " dxdz = "   << beam_dxdz() << std::endl
194            << "Beam y0 = " << beam_y0()
195            << " dydz = "   << beam_dydz() << std::endl;
196   }
197 }
198 
199 //=============================================================================
200 // Resize Utilities
201 //=============================================================================
202 bool
203 VTVZ_StorableBank::
204 set_n_vertex( int4 nvertex )
205 { TRY_Bank_Type bankType = form_bank_type(nvertex) ;
206   StorableBank::set_bank_type(bankType) ;
207 
208   int ndata = VTVZ_StorableBank_format::n_header_words + 
209               nvertex * VTVZ_StorableBank_format::run2_vertex_block_length ;
210   return set_I4_element( 0, VTVZ_StorableBank_format::n_data_words_index, ndata ) ;
211 }
212 
213 
214 
215 //*****************************************************************************
216 // The End
217 //*****************************************************************************
218 

source navigation ] diff markup ] identifier search ] freetext search ] file search ]

This page was automatically generated by the LXR engine.
The LXR team
Valid HTML 4.01!

Send problems or questions to cdfcode@fnal.gov