SND@LHC Software
Loading...
Searching...
No Matches
StateOnPlane.cc
Go to the documentation of this file.
1/* Copyright 2008-2010, Technische Universitaet Muenchen,
2 Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
3
4 This file is part of GENFIT.
5
6 GENFIT is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 GENFIT is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#include "StateOnPlane.h"
21#include "AbsTrackRep.h"
22
23#include <cassert>
24#include <iostream>
25#include <TBuffer.h>
26
27namespace genfit {
28
29
30void StateOnPlane::Print(Option_t*) const {
31 std::cout << "genfit::StateOnPlane ";
32 std::cout << " state vector: "; state_.Print();
33 if (sharedPlane_ != NULL) {
34 std::cout << " defined in plane "; sharedPlane_->Print();
35 TVector3 pos, mom;
36 getRep()->getPosMom(*this, pos, mom);
37 std::cout << " 3D position: "; pos.Print();
38 std::cout << " 3D momentum: "; mom.Print();
39 }
40}
41
42
43// Modified from auto-generated Streamer to account for sharedPlane_
44// also ignore rep_, this has to be set when loading the object owning
45// this state.
46void StateOnPlane::Streamer(TBuffer &R__b)
47{
48 // Stream an object of class genfit::StateOnPlane.
49
50 //This works around a msvc bug and should be harmless on other platforms
51 typedef ::genfit::StateOnPlane thisClass;
52 UInt_t R__s, R__c;
53 if (R__b.IsReading()) {
54 Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
55 //TObject::Streamer(R__b);
56 state_.Streamer(R__b);
57 auxInfo_.Streamer(R__b);
58 sharedPlane_.reset(); // needs to be set by owner;
59 rep_ = NULL; // needs to be set by owner
60 R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
61 } else {
62 R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
63 //TObject::Streamer(R__b);
64 state_.Streamer(R__b);
65 auxInfo_.Streamer(R__b);
66 R__b.SetByteCount(R__c, kTRUE);
67 }
68}
69
70
71} /* End of namespace genfit */
virtual void getPosMom(const StateOnPlane &state, TVector3 &pos, TVector3 &mom) const =0
Get cartesian position and momentum vector of a state.
A state with arbitrary dimension defined in a DetPlane.
virtual void Print(Option_t *option="") const
SharedPlanePtr sharedPlane_
const AbsTrackRep * rep_
Shared ownership. '!' in order to silence ROOT, custom streamer writes and reads this.
const AbsTrackRep * getRep() const
Matrix inversion tools.
Definition AbsBField.h:29