# TStreamerInfo missing

**URL:** <https://root-forum.cern.ch/t/tstreamerinfo-missing/32457>\
**Category:** Newbie\
**Created:** [January 26, 2019, 8:48pm UTC](https://root-forum.cern.ch/t/tstreamerinfo-missing/32457 "2019-01-26T20:48:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jstock](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@jstock](https://root-forum.cern.ch/u/jstock)\
**Post date:** [January 26, 2019, 8:48pm UTC](https://root-forum.cern.ch/t/tstreamerinfo-missing/32457/1 "2019-01-26T20:48:20Z")

</div>

I am trying to load a root file in a TChain. The root file contains a Tree with my own event class in it.  
I load the event class into ROOT (The exact same file as was used in the module that made the tree), and then when I call GetEntries I get issues.

```auto
root [0] .L SMTracks.cxx
root [1] ana::smts* track_rec=0
(ana::smts *) nullptr
root [2] auto ch=new TChain("StopMuonFilter3x1x1/TrackRecords");
root [3] ch->SetBranchAddress("TrackRecordBranch", &track_rec);
root [4] ch->Add("~/wa105-r1002-s1-StopMuonFilter.root")
(int) 1
root [5] auto nEntries=ch->GetEntries();
Warning in <TStreamerInfo::Build>: pair<double,double>: base class __pair_base<double,double> has no streamer or dictionary it will not be saved
root [6] nEntries
(long long) 335
root [7] ch->GetEntry(0)
Error in <TClass::New with placement>: cannot create object of class ana::smtrec::sp version 1 at address 0x557d1308fa40
Error in <TClass::New with placement>: cannot create object of class ana::smtrec::sp version 1 at address 0x557d1308fa58
Error in <TClass::New with placement>: cannot create object of class ana::smtrec::sp version 1 at address 0x557d1308fa70
Error in <TClass::New with placement>: cannot create object of class ana::smtrec::sp version 1 at address 0x557d1308fa88
Error in <TClass::New with placement>: cannot create object of class ana::smtrec::sp version 1 at address 0x557d1308faa0

```

When I try compiling my event class at loading, I have a different problem.

```auto
In file included from /home/USER/Documents/GROUP/ROOT/MODULE/CLASS_cxx_ACLiC_dict.cxx:31:
/usr/include/root/TCollectionProxyInfo.h: In instantiation of ‘static void* ROOT::Detail::TCollectionProxyInfo::Type<T>::construct(void*, std::size_t) [with T = std::vector<ana::smtrec::sp>; std::size_t = long unsigned int]’:
/usr/include/root/TCollectionProxyInfo.h:568:17: required from ‘static ROOT::Detail::TCollectionProxyInfo* ROOT::Detail::TCollectionProxyInfo::Generate(const T&) [with T = ROOT::Detail::TCollectionProxyInfo::Pushback<std::vector<ana::smtrec::sp> >]’
/home/USER/Documents/GROUP/ROOT/3x1x1_Tracks/SMTracks_cxx_ACLiC_dict.cxx:417:131: required from here
/usr/include/root/TCollectionProxyInfo.h:334:13: error: no matching function for call to ‘ana::smtrec::sp::sp()’

```

It looks like for some reason ROOT is calling a default constructor? I specifically DO NOT have a default constructor for this class. Adding one would make no sense.

Can someone help me understand these errors? I believe my code for the event class file is identical to the version used to make the ROOT file I am loading.

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [January 28, 2019, 11:28am UTC](https://root-forum.cern.ch/t/tstreamerinfo-missing/32457/2 "2019-01-28T11:28:46Z")

</div>

@pcanal can you take a look please? Thanks!

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [January 28, 2019, 6:06pm UTC](https://root-forum.cern.ch/t/tstreamerinfo-missing/32457/3 "2019-01-28T18:06:34Z")

</div>

I/O support for interpreted class is not yet fully implemented, hence you need to compile your macro.

> I believe my code for the event class file is identical to the version used to make the ROOT file I am loading.

Humm … odd … maybe the difference is in the (lack of) LinkDef file?

> It looks like for some reason ROOT is calling a default constructor? I specifically DO NOT have a default constructor for this class. Adding one would make no sense.

The I/O needs to create objects without passing arguments to the constructor (since it can not guess what the arguments should be or even how to construct those arguments).

To support the case where adding a normal default constructor does not make sense (and/or is detrimental to the design and use) for a user class, we added the concept of an I/O constructor. This is a constructor with a dummy argument that is recognize and used by the I/O. The default dummy parameter is TRootIOCtor:

```auto
class TRootIOCtor;

class MyClass {
   MyClass() = delete;
public:
   MyClass(TRootIOCtor*) ... {}; // Constructor setting the members to a sane default (the persistent member will be over-written by the I/O but things like pointer needs to have a valid value (like nullptr).
   .....
};

```
